diff --git a/sevenkeys/database/sql/createdb.sql b/sevenkeys/database/sql/createdb.sql index 2d6b9a1..27537df 100644 --- a/sevenkeys/database/sql/createdb.sql +++ b/sevenkeys/database/sql/createdb.sql @@ -25,12 +25,18 @@ CREATE TABLE IF NOT EXISTS CardPrinting ( Language VARCHAR(3) NOT NULL ); -CREATE TABLE IF NOT EXISTS CardStorageLocation ( +CREATE TABLE IF NOT EXISTS StorageArea ( + Id INT AUTO_INCREMENT PRIMARY KEY, + Name VARCHAR(100) NOT NULL, + StorageType ENUM('Toolkit', 'Deck', 'Binder', 'Bulk') +); + +CREATE TABLE IF NOT EXISTS CardLocation ( Id INT AUTO_INCREMENT PRIMARY KEY, CardPrintingId VARCHAR(37) NOT NULL, FOREIGN KEY (CardPrintingId) REFERENCES CardPrinting(Id), CardCondition ENUM('Mint', 'Near Mint', 'Excellent', 'Good', 'Light Played', 'Played', 'Poor') NOT NULL, - StorageBox VARCHAR(20) NOT NULL, - Position INT NOT NULL, - Source VARCHAR(100) NULL + StorageAreaId INT NOT NULL, + FOREIGN KEY (StorageAreaId) REFERENCES StorageArea(Id), + Location INT NULL );