CREATE DATABASE IF NOT EXISTS sevenkeys;

USE sevenkeys;

CREATE TABLE IF NOT EXISTS CacheTimestamps (
	CacheType ENUM('AllCardsBulkData') PRIMARY KEY,
	Stamp DATETIME NOT NULL
);

CREATE TABLE IF NOT EXISTS Gamepiece (
	Id INT AUTO_INCREMENT PRIMARY KEY,
	Name VARCHAR(150) NOT NULL
);

CREATE TABLE IF NOT EXISTS CardPrinting (
	Id INT AUTO_INCREMENT PRIMARY KEY,
	GamepieceId INT NOT NULL,
	FOREIGN KEY (GamepieceId) REFERENCES Gamepiece(Id),
	SetCode VARCHAR(6) NOT NULL,
	ImageUrl VARCHAR(2048) NOT NULL
);
