From 2d5e568b621b7683ae44e855f938fda82a76b754 Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Sat, 15 Mar 2025 19:50:01 +0100 Subject: [PATCH] Changed database structure --- migrations/20250310175116_tables.sql | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/migrations/20250310175116_tables.sql b/migrations/20250310175116_tables.sql index ee4920c..bb41825 100644 --- a/migrations/20250310175116_tables.sql +++ b/migrations/20250310175116_tables.sql @@ -29,13 +29,21 @@ CREATE TABLE items ( 'name' TEXT NOT NULL, 'rarity' INTEGER NOT NULL, 'image' TEXT NOT NULL, - 'case' INTEGER NOT NULL, - FOREIGN KEY ('case') REFERENCES cases ('id') + 'price' FLOAT NOT NULL ); CREATE TABLE cases ( 'id' INTEGER PRIMARY KEY NOT NULL , 'uuid' TEXT UNIQUE NOT NULL, 'name' TEXT NOT NULL, - 'image' TEXT NOT NULL + 'image' TEXT NOT NULL, + 'price' FLOAT NOT NULL +); + +CREATE TABLE items_cases ( + 'item' INTEGER NOT NULL, + 'case' INTEGER NOT NULL, + FOREIGN KEY ('item') REFERENCES items ('id'), + FOREIGN KEY ('case') REFERENCES cases ('id'), + PRIMARY KEY ('item', 'case') ); \ No newline at end of file