2024-04-23 16:52:48 +00:00
|
|
|
CREATE DATABASE IF NOT EXISTS sevenkeys;
|
2024-04-24 10:54:49 +00:00
|
|
|
|
|
|
|
USE sevenkeys;
|
|
|
|
|
2024-05-20 16:21:16 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS CacheTimestamp (
|
2024-05-19 14:01:18 +00:00
|
|
|
CacheType ENUM('AllCardsBulkData') PRIMARY KEY,
|
2024-05-19 09:05:29 +00:00
|
|
|
Stamp DATETIME NOT NULL
|
2024-05-19 09:01:57 +00:00
|
|
|
);
|
|
|
|
|
2024-05-19 19:29:50 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS ExpansionSet (
|
|
|
|
SetCode VARCHAR(6) PRIMARY KEY,
|
|
|
|
Name VARCHAR(60) NOT NULL,
|
|
|
|
CardCount INT NOT NULL,
|
|
|
|
IconSvgUri VARCHAR(60) NOT NULL
|
2024-04-24 10:54:49 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS CardPrinting (
|
2024-06-03 16:08:15 +00:00
|
|
|
Id VARCHAR(37) PRIMARY KEY, -- GUID, plus one character for foil/nonfoil
|
2024-05-20 15:54:49 +00:00
|
|
|
Name VARCHAR(150) NOT NULL,
|
2024-04-28 14:13:47 +00:00
|
|
|
SetCode VARCHAR(6) NOT NULL,
|
2024-05-19 19:29:50 +00:00
|
|
|
FOREIGN KEY (SetCode) REFERENCES ExpansionSet(SetCode),
|
2024-05-29 19:55:38 +00:00
|
|
|
IsFoil BOOLEAN NOT NULL,
|
2024-05-19 19:29:50 +00:00
|
|
|
IsPromo BOOLEAN NOT NULL,
|
|
|
|
CollectorNumber VARCHAR(10) NOT NULL,
|
|
|
|
Language VARCHAR(3) NOT NULL
|
2024-04-24 10:54:49 +00:00
|
|
|
);
|
2024-05-27 11:05:52 +00:00
|
|
|
|
2024-05-29 21:03:40 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS CardStorageLocation (
|
|
|
|
Id INT AUTO_INCREMENT PRIMARY KEY,
|
2024-06-03 16:08:15 +00:00
|
|
|
CardPrintingId VARCHAR(37) NOT NULL,
|
2024-05-29 21:03:40 +00:00
|
|
|
FOREIGN KEY (CardPrintingId) REFERENCES CardPrinting(Id),
|
2024-06-03 17:18:35 +00:00
|
|
|
CardCondition ENUM('Mint', 'Near Mint', 'Excellent', 'Good', 'Light Played', 'Played', 'Poor') NOT NULL,
|
2024-05-29 21:03:40 +00:00
|
|
|
StorageBox VARCHAR(20) NOT NULL,
|
|
|
|
Position INT NOT NULL,
|
|
|
|
Source VARCHAR(100) NULL
|
|
|
|
);
|