From ea4dffbdc6bfaaef63ac38bbb985e254a1bad201 Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Thu, 3 Sep 2026 02:01:38 +0200 Subject: [PATCH] Updated database schemas --- migrations/20260831172036_create_table_skins.sql | 14 ++++++++++++-- .../20260901220106_create_table_user-skins.sql | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 migrations/20260901220106_create_table_user-skins.sql diff --git a/migrations/20260831172036_create_table_skins.sql b/migrations/20260831172036_create_table_skins.sql index bc9d540..431a0d3 100644 --- a/migrations/20260831172036_create_table_skins.sql +++ b/migrations/20260831172036_create_table_skins.sql @@ -15,11 +15,21 @@ CREATE TABLE IF NOT EXISTS rarity ( CREATE TABLE IF NOT EXISTS skins ( id uuid DEFAULT gen_random_uuid() PRIMARY KEY, - weapon uuid REFERENCES weapons(id), - rarity uuid REFERENCES rarity(id), + weapon uuid REFERENCES weapons(id) NOT NULL, + rarity uuid REFERENCES rarity(id) NOT NULL, paint_index integer NOT NULL, display varchar NOT NULL, min_float float NOT NULL, max_float float 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 ); \ No newline at end of file diff --git a/migrations/20260901220106_create_table_user-skins.sql b/migrations/20260901220106_create_table_user-skins.sql new file mode 100644 index 0000000..3b947cd --- /dev/null +++ b/migrations/20260901220106_create_table_user-skins.sql @@ -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 +); \ No newline at end of file