Files
api/migrations/20260831172036_create_table_skins.sql

25 lines
732 B
SQL

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