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 "Team" (
"id" INT,
"team_api_id" INT UNIQUE,
"team_fifa_api_id" INT UNIQUE,
"team_long_name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team_Attributes" (
"id" INT,
"team_fifa_api_id" INT,
"team_api_id" INT,
"date" TEXT,
"buildUpPlaySpeedClass" TEXT,
"buildUpPlayPassingClass" TEXT,
"chanceCreationPassingClass" TEXT,
"defencePressureClass" 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 "Team" VALUES ("1", "1001", "5001", "KSV Cercle Brugge");
INSERT INTO "Team" VALUES ("2", "1002", "5002", "RSC Anderlecht");
INSERT INTO "Team" VALUES ("3", "1003", "5003", "Club Brugge KV");
INSERT INTO "Team" VALUES ("4", "1004", "5004", "Standard Liege");
INSERT INTO "Team_Attributes" VALUES ("1", "5001", "1001", "2020-01-01", "slow", "balanced", "high", "medium");
INSERT INTO "Team_Attributes" VALUES ("2", "5001", "1001", "2021-01-01", "balanced", "fast", "medium", "high");
INSERT INTO "Team_Attributes" VALUES ("3", "5002", "1002", "2020-06-01", "fast", "fast", "high", "high");
INSERT INTO "Team_Attributes" VALUES ("4", "5003", "1003", "2020-03-15", "fast", "balanced", "balanced", "medium");
INSERT INTO "Team_Attributes" VALUES ("5", "5004", "1004", "2021-05-20", "slow", "slow", "low", "low");
INSERT INTO "Team_Attributes" VALUES ("6", "5001", "1001", "2022-01-01", "fast", "fast", "high", "high");