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 "League" (
"id" INT UNIQUE,
"country_id" INT,
"name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Match" (
"id" INT,
"league_id" INT,
"season" TEXT,
"stage" INT,
"date" TEXT,
"home_team_goal" INT,
"away_team_goal" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("league_id") REFERENCES "League"("id")
);



INSERT INTO "League" VALUES ("1", "56", "Belgium Jupiler League");
INSERT INTO "League" VALUES ("2", "57", "Dutch Eredivisie");
INSERT INTO "League" VALUES ("3", "58", "French Ligue 1");
INSERT INTO "Match" VALUES ("101", "1", "2008/2009", "1", "2008-09-24", "2", "1");
INSERT INTO "Match" VALUES ("102", "1", "2008/2009", "2", "2008-10-01", "0", "0");
INSERT INTO "Match" VALUES ("103", "1", "2008/2009", "3", "2008-09-24", "3", "3");
INSERT INTO "Match" VALUES ("104", "2", "2008/2009", "1", "2008-09-24", "1", "2");
INSERT INTO "Match" VALUES ("105", "3", "2008/2009", "1", "2008-09-24", "4", "0");
INSERT INTO "Match" VALUES ("106", "1", "2007/2008", "1", "2007-09-24", "1", "1");
INSERT INTO "Match" VALUES ("107", "1", "2008/2009", "4", "2008-09-25", "2", "2");
INSERT INTO "Match" VALUES ("108", "1", "2008/2009", "5", "2008-09-24", "0", "1");