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,
"team_short_name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team_Attributes" (
"id" INT,
"team_fifa_api_id" INT,
"team_api_id" INT,
"date" TEXT,
"buildUpPlaySpeed" INT,
"buildUpPlayPositioningClass" 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", "ADO Den Haag", "ADO");
INSERT INTO "Team" VALUES ("2", "1002", "5002", "Ajax", "AJA");
INSERT INTO "Team" VALUES ("3", "1003", "5003", "PSV Eindhoven", "PSV");
INSERT INTO "Team" VALUES ("4", "1004", "5004", "Feyenoord", "FEY");
INSERT INTO "Team_Attributes" VALUES ("1", "5001", "1001", "2023-01-15", "70", "Free");
INSERT INTO "Team_Attributes" VALUES ("2", "5001", "1001", "2023-02-20", "65", "Structured");
INSERT INTO "Team_Attributes" VALUES ("3", "5001", "1001", "2023-03-10", "68", "Free");
INSERT INTO "Team_Attributes" VALUES ("4", "5002", "1002", "2023-01-15", "80", "Very Free");
INSERT INTO "Team_Attributes" VALUES ("5", "5003", "1003", "2023-01-15", "75", "Structured");
INSERT INTO "Team_Attributes" VALUES ("6", "5004", "1004", "2023-01-15", "60", "Very Structured");
INSERT INTO "Team_Attributes" VALUES ("7", "5001", "1001", "2023-04-01", "72", "Free");
INSERT INTO "Team_Attributes" VALUES ("8", "5001", "1001", "2023-05-01", "66", "Structured");
INSERT INTO "Team_Attributes" VALUES ("9", "5002", "1002", "2023-02-20", "82", "Very Free");
INSERT INTO "Team_Attributes" VALUES ("10", "5003", "1003", "2023-02-20", "77", "Structured");