mirror of https://github.com/skygpu/skynet.git
1.1 KiB
1.1 KiB
create db in postgres:
CREATE USER skynet WITH PASSWORD 'password';
CREATE DATABASE skynet_art_bot;
GRANT ALL PRIVILEGES ON DATABASE skynet_art_bot TO skynet;
CREATE SCHEMA IF NOT EXISTS skynet;
CREATE TABLE IF NOT EXISTS skynet.user(
id SERIAL PRIMARY KEY NOT NULL,
INT,
tg_id VARCHAR(128),
wp_id VARCHAR(128),
mx_id VARCHAR(128),
ig_id generated INT NOT NULL,
DATE NOT NULL,
joined
last_prompt TEXT,role VARCHAR(128) NOT NULL
);ALTER TABLE skynet.user
ADD CONSTRAINT tg_unique
UNIQUE (tg_id);
ALTER TABLE skynet.user
ADD CONSTRAINT wp_unique
UNIQUE (wp_id);
ALTER TABLE skynet.user
ADD CONSTRAINT mx_unique
UNIQUE (mx_id);
ALTER TABLE skynet.user
ADD CONSTRAINT ig_unique
UNIQUE (ig_id);
CREATE TABLE IF NOT EXISTS skynet.user_config(
id SERIAL NOT NULL,
VARCHAR(128) NOT NULL,
algo INT NOT NULL,
step INT NOT NULL,
width INT NOT NULL,
height INT,
seed INT NOT NULL,
guidance VARCHAR(128)
upscaler
);ALTER TABLE skynet.user_config
ADD FOREIGN KEY(id)
REFERENCES skynet.user(id);