Updated database schemas

This commit is contained in:
2026-09-03 02:01:38 +02:00
parent e1652f4b07
commit ea4dffbdc6
2 changed files with 19 additions and 2 deletions

View File

@@ -15,11 +15,21 @@ CREATE TABLE IF NOT EXISTS rarity (
CREATE TABLE IF NOT EXISTS skins ( CREATE TABLE IF NOT EXISTS skins (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY, id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
weapon uuid REFERENCES weapons(id), weapon uuid REFERENCES weapons(id) NOT NULL,
rarity uuid REFERENCES rarity(id), rarity uuid REFERENCES rarity(id) NOT NULL,
paint_index integer NOT NULL, paint_index integer NOT NULL,
display varchar NOT NULL, display varchar NOT NULL,
min_float float NOT NULL, min_float float NOT NULL,
max_float float NOT NULL, max_float float NOT NULL,
legacy boolean NOT NULL legacy boolean NOT NULL
); );
CREATE TABLE IF NOT EXISTS agents (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
rarity uuid REFERENCES rarity(id) NOT NULL,
name varchar NOT NULL,
display varchar NOT NULL,
def_index integer NOT NULL,
team integer NOT NULL, -- 0 = CT, 1 = T, 2 = BOTH
model_player varchar NOT NULl
);

View File

@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS user_skins (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
user_id uuid REFERENCES users(id) NOT NULL,
skin_id uuid REFERENCES skins(id),
agent_id uuid REFERENCES agents(id),
team integer NOT NULL -- 0 = CT, 1 = T, 2 = BOTH
);