Files
YaeMikoBot/scripts/postgres/02-users.sql

59 lines
2.7 KiB
SQL
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
CREATE TABLE groups (
id serial NOT NULL PRIMARY KEY,
name text,
is_vip boolean DEFAULT false NOT NULL,
is_premium boolean DEFAULT false NOT NULL,
is_admin boolean DEFAULT false NOT NULL,
multiplier numeric DEFAULT 1 NOT NULL,
sale double precision DEFAULT 1 NOT NULL,
max_multigen integer DEFAULT 2 NOT NULL,
is_tester boolean DEFAULT false NOT NULL,
max_waifus integer DEFAULT 3 NOT NULL
);
CREATE TABLE users (
id INT8 NOT NULL PRIMARY KEY,
balance DECIMAL(20,0) NOT NULL DEFAULT 0,
name TEXT NOT NULL,
group_id INT NOT NULL DEFAULT 1 REFERENCES groups(id),
level INT DEFAULT 1,
exp DECIMAL(20, 0) DEFAULT 0,
work_id INT NOT NULL DEFAULT 1 REFERENCES works(id),
work_time TIMESTAMP DEFAULT now(),
auto_id int DEFAULT NULL,
business_id int DEFAULT NULL,
maid_id int DEFAULT NULL,
miner_id int DEFAULT NULL,
income_time timestamp DEFAULT now(),
btc decimal(16,6) DEFAULT 0,
invested decimal(20, 0) DEFAULT 0,
pair_id int8 DEFAULT NULL,
greeting text DEFAULT 'Привет',
donat int DEFAULT 0,
fraction_id int DEFAULT NULL,
money_income decimal(20, 0) DEFAULT 0,
exp_income decimal(20, 0) DEFAULT 0,
btc_income decimal(16, 6) DEFAULT 0,
waifu_search_time timestamp DEFAULT now()
);
CREATE UNIQUE INDEX users_uindex ON users(id);
CREATE UNIQUE INDEX groups_uindex ON groups(id);
BEGIN TRANSACTION;
INSERT INTO groups VALUES (1, '✨Пользователь✨', false, false, false, 1.0, 1, 3, false, 3);
INSERT INTO groups VALUES (2, '🔮VIP🔮', true, false, false, 2.5, 0.9, 5, false, 3);
INSERT INTO groups VALUES (3, '👾Премиум🌟', true, true, false, 5, 0.75, 7, false, 3);
INSERT INTO groups VALUES (4, '💎Админ💎', true, true, true, 10, 0.6, 10, true, 3);
INSERT INTO groups VALUES (5, '💰🔱СОЗДАТЕЛЬ🔱💰', true, true, true, 20, 0.5, 10, true, 3);
INSERT INTO groups VALUES (6, '⚠Тостер⚠', true, false, false, 3, 0.85, 3, true, 3);
INSERT INTO groups VALUES (1488, '📚Экономист📈', true, true, false, 14.88, 0.6, 3, false, 3);
INSERT INTO groups VALUES (1337, '🏳🌈ToP GaY In ThE WorlD🏳🌈🌈', true, true, false, 13.37, 0.7, 3, false, 3);
ALTER SEQUENCE groups_id_seq RESTART WITH 7;
INSERT INTO users
VALUES (314834933, 999999999, 'scuroneko', 5, 1, 0, 1, '0001-01-01 00:00:00.000000', 5, 15, 6, 14, '0001-01-01 00:00:00.000000', 999999.000000, 0, null, 'Привет', 0, null, 0, 0, 0.000000, '0001-01-01 00:00:00.000000'),
(7915366224,0,'Абола',4,1,0,1,'2026-01-23 08:52:13.911110',null,null,null,null,'2026-01-23 08:52:13.911110',0.000000,0,null,'Привет',0,null,0,0,0.000000,'2026-01-23 08:52:13.911110');
COMMIT TRANSACTION;