PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "Match" (
"id" INT,
"league_id" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team" (
"id" INT,
"team_api_id" INT UNIQUE,
"team_fifa_api_id" INT UNIQUE,
"team_long_name" TEXT,
"team_short_name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team_Attributes" (
"id" INT,
"team_fifa_api_id" INT,
"team_api_id" INT,
"date" TEXT,
"chanceCreationPassing" INT,
"chanceCreationPassingClass" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("team_api_id") REFERENCES "Team"("team_api_id"),
FOREIGN KEY ("team_fifa_api_id") REFERENCES "Team"("team_fifa_api_id")
);



INSERT INTO "Match" VALUES ("1", "100");
INSERT INTO "Match" VALUES ("2", "101");
INSERT INTO "Team" VALUES ("1", "5001", "6001", "PEC Zwolle", "PECZ");
INSERT INTO "Team" VALUES ("2", "5002", "6002", "Ajax", "AJX");
INSERT INTO "Team" VALUES ("3", "5003", "6003", "Feyenoord", "FEY");
INSERT INTO "Team" VALUES ("4", "5004", "6004", "PSV Eindhoven", "PSV");
INSERT INTO "Team_Attributes" VALUES ("1", "6001", "5001", "2013-09-20 00:00:00", "75", "High");
INSERT INTO "Team_Attributes" VALUES ("2", "6001", "5001", "2013-09-19 00:00:00", "60", "Medium");
INSERT INTO "Team_Attributes" VALUES ("3", "6002", "5002", "2013-09-20 00:00:00", "80", "Very High");
INSERT INTO "Team_Attributes" VALUES ("4", "6003", "5003", "2013-09-20 00:00:00", "50", "Medium");
INSERT INTO "Team_Attributes" VALUES ("5", "6004", "5004", "2013-09-20 00:00:00", "40", "Low");
INSERT INTO "Team_Attributes" VALUES ("6", "6001", "5001", "2013-10-01 00:00:00", "70", "High");