Create tables for Cardtrader data
This commit is contained in:
parent
cb78b86fa1
commit
1f93aef749
|
@ -0,0 +1,43 @@
|
||||||
|
-- +goose Up
|
||||||
|
-- +goose StatementBegin
|
||||||
|
CREATE TABLE IF NOT EXISTS CardtraderGame (
|
||||||
|
Id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
Name VARCHAR(255) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS CardtraderCategory (
|
||||||
|
Id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
CardtraderGameId INT NOT NULL,
|
||||||
|
FOREIGN KEY (CardtraderGameId) REFERENCES CardtraderGame(Id),
|
||||||
|
Name VARCHAR(255) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS CardtraderExpansion (
|
||||||
|
Id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
CardtraderGameId INT NOT NULL,
|
||||||
|
FOREIGN KEY (CardtraderGameId) REFERENCES CardtraderGame(Id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS CardtraderBlueprint (
|
||||||
|
Id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
CardtraderGameId INT NOT NULL,
|
||||||
|
FOREIGN KEY (CardtraderGameId) REFERENCES CardtraderGame(Id),
|
||||||
|
CardtraderCategoryId INT NOT NULL,
|
||||||
|
FOREIGN KEY (CardtraderCategoryId) REFERENCES CardtraderCategory(Id),
|
||||||
|
CardtraderExpansionId INT NOT NULL,
|
||||||
|
FOREIGN KEY (CardtraderExpansionId) REFERENCES CardtraderExpansion(Id),
|
||||||
|
Name VARCHAR(255) NOT NULL,
|
||||||
|
CollectorNumber VARCHAR(10) NOT NULL
|
||||||
|
);
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
-- +goose StatementBegin
|
||||||
|
DROP TABLE IF EXISTS CardtraderGame;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS CardtraderCategory;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS CardtraderExpansion;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS CardtraderBlueprint;
|
||||||
|
-- +goose StatementEnd
|
Loading…
Reference in New Issue