Changed database structure

This commit is contained in:
2025-03-15 19:50:01 +01:00
parent 748ff2b66a
commit 2d5e568b62

View File

@@ -29,13 +29,21 @@ CREATE TABLE items (
'name' TEXT NOT NULL, 'name' TEXT NOT NULL,
'rarity' INTEGER NOT NULL, 'rarity' INTEGER NOT NULL,
'image' TEXT NOT NULL, 'image' TEXT NOT NULL,
'case' INTEGER NOT NULL, 'price' FLOAT NOT NULL
FOREIGN KEY ('case') REFERENCES cases ('id')
); );
CREATE TABLE cases ( CREATE TABLE cases (
'id' INTEGER PRIMARY KEY NOT NULL , 'id' INTEGER PRIMARY KEY NOT NULL ,
'uuid' TEXT UNIQUE NOT NULL, 'uuid' TEXT UNIQUE NOT NULL,
'name' TEXT 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')
); );