<commit_before>DROP TABLE IF EXISTS playerStatistic;
DROP TABLE IF EXISTS teamStatistic;
DROP TABLE IF EXISTS statistic;
DROP TABLE IF EXISTS favoritePlayer;
DROP TABLE IF EXISTS favoriteTeam;
DROP TABLE IF EXISTS game;
DROP TABLE IF EXISTS player;
DROP TABLE IF EXISTS team;
DROP TABLE IF EXISTS sport;
DROP TABLE IF EXISTS profile;


CREATE TABLE profile (
	profileId         INT UNSIGNED AUTO_INCREMENT NOT NULL,
	profileUserName   VARCHAR(32)                 NOT NULL,
	profileEmail      VARCHAR(128)                NOT NULL,
	profileActivation CHAR(32),
	profileHash       CHAR(128)                   NOT NULL,
	profileSalt       CHAR(64)                    NOT NULL,
	UNIQUE (profileEmail),
	UNIQUE (profileUserName),
	PRIMARY KEY (profileId)
);

CREATE TABLE sport (
	sportId     INT UNSIGNED AUTO_INCREMENT NOT NULL,
	sportName   VARCHAR(32)                 NOT NULL,
	sportLeague VARCHAR(32)                 NOT NULL,
	UNIQUE (sportName),
	UNIQUE (sportLeague),
	PRIMARY KEY (sportId)
);

CREATE TABLE team (
	teamId    INT UNSIGNED AUTO_INCREMENT NOT NULL,
	teamSportId INT UNSIGNED              NOT NULL,
	teamApiId VARCHAR(10)                NOT NULL,
	teamName  VARCHAR(32)                 NOT NULL,
	teamCity  VARCHAR(50)                 NOT NULL,
	INDEX (teamApiId),
	INDEX (teamName),
	FOREIGN KEY (teamSportId) REFERENCES sport (sportId),
	PRIMARY KEY (teamId)
);

CREATE TABLE player (
	playerId    INT UNSIGNED AUTO_INCREMENT NOT NULL,
	playerApiId INT UNSIGNED                NOT NULL,
	playerSportId     INT UNSIGNED                NOT NULL,
	playerTeamId      INT UNSIGNED                NOT NULL,
	playerName  VARCHAR(100)                 NOT NULL,
	INDEX (playerApiId),
	UNIQUE (playerId),
	FOREIGN KEY (playerSportId) REFERENCES sport (sportId),
	FOREIGN KEY (playerTeamId) REFERENCES team (teamId),
	PRIMARY KEY (playerId)
);

CREATE TABLE game (
	gameId           INT UNSIGNED AUTO_INCREMENT NOT NULL,
	gameFirstTeamId  INT UNSIGNED                NOT NULL,
	gameSecondTeamId INT UNSIGNED                NOT NULL,
	gameTime         DATETIME                    NOT NULL,
	INDEX (gameFirstTeamId),
	INDEX (gameSecondTeamId),
	FOREIGN KEY (gameFirstTeamId) REFERENCES team (teamId),
	FOREIGN KEY (gameSecondTeamId) REFERENCES team (teamId),
	PRIMARY KEY (gameId)
);

CREATE TABLE favoriteTeam (
	favoriteTeamTeamId    INT UNSIGNED NOT NULL,
	favoriteTeamProfileId INT UNSIGNED NOT NULL,
	INDEX (favoriteTeamTeamId),
	INDEX (favoriteTeamProfileId),
	FOREIGN KEY (favoriteTeamTeamId) REFERENCES team (teamId),
	FOREIGN KEY (favoriteTeamProfileId) REFERENCES profile (profileId),
	PRIMARY KEY (favoriteTeamTeamId,favoriteTeamProfileId)
);

CREATE TABLE favoritePlayer (
	favoritePlayerPlayerId  INT UNSIGNED NOT NULL,
	favoritePlayerProfileId INT UNSIGNED NOT NULL,
	INDEX (favoritePlayerPlayerId),
	INDEX (favoritePlayerProfileId),
	FOREIGN KEY (favoritePlayerPlayerId) REFERENCES player (playerId),
	FOREIGN KEY (favoritePlayerProfileId) REFERENCES profile (profileId),
	PRIMARY KEY (favoritePlayerPlayerId, favoritePlayerProfileId)
);

CREATE TABLE statistic (
	statisticId   INT UNSIGNED AUTO_INCREMENT NOT NULL,
	statisticName VARCHAR(255)                NOT NULL,
	PRIMARY KEY (statisticId)
);

CREATE TABLE teamStatistic (
	teamStatisticTeamId      INT UNSIGNED NOT NULL,
	teamStatisticValue       VARCHAR(250)  NOT NULL,
	teamStatisticStatisticId INT UNSIGNED NOT NULL,
	teamStatisticGameId      INT UNSIGNED NOT NULL,
	INDEX (teamStatisticTeamId),
	INDEX (teamStatisticStatisticId),
	INDEX (teamStatisticGameId),
	FOREIGN KEY (teamStatisticTeamId) REFERENCES team (teamId),
	FOREIGN KEY (teamStatisticStatisticId) REFERENCES statistic (statisticId),
	FOREIGN KEY (teamStatisticGameId) REFERENCES game (gameId)
);

CREATE TABLE playerStatistic (
	playerStatisticGameId                     INT UNSIGNED NOT NULL,
	playerStatisticPlayerId    INT UNSIGNED NOT NULL,
	playerStatisticTeamId      INT UNSIGNED NOT NULL,
	playerStatisticStatisticId INT UNSIGNED NOT NULL,
	playerStatisticValue       VARCHAR(250)  NOT NULL,
	INDEX (playerStatisticPlayerId),
	INDEX (playerStatisticTeamId),
	INDEX (playerStatisticGameId),
	FOREIGN KEY (playerStatisticPlayerId) REFERENCES player (playerId),
	FOREIGN KEY (playerStatisticTeamId) REFERENCES team (teamId),<commit_msg>Changed Value from int to string<commit_after>DROP TABLE IF EXISTS playerStatistic;
DROP TABLE IF EXISTS teamStatistic;
DROP TABLE IF EXISTS statistic;
DROP TABLE IF EXISTS favoritePlayer;
DROP TABLE IF EXISTS favoriteTeam;
DROP TABLE IF EXISTS game;
DROP TABLE IF EXISTS player;
DROP TABLE IF EXISTS team;
DROP TABLE IF EXISTS sport;
DROP TABLE IF EXISTS profile;


CREATE TABLE profile (
	profileId         INT UNSIGNED AUTO_INCREMENT NOT NULL,
	profileUserName   VARCHAR(32)                 NOT NULL,
	profileEmail      VARCHAR(128)                NOT NULL,
	profileActivation CHAR(32),
	profileHash       CHAR(128)                   NOT NULL,
	profileSalt       CHAR(64)                    NOT NULL,
	UNIQUE (profileEmail),
	UNIQUE (profileUserName),
	PRIMARY KEY (profileId)
);

CREATE TABLE sport (
	sportId     INT UNSIGNED AUTO_INCREMENT NOT NULL,
	sportName   VARCHAR(32)                 NOT NULL,
	sportLeague VARCHAR(32)                 NOT NULL,
	UNIQUE (sportName),
	UNIQUE (sportLeague),
	PRIMARY KEY (sportId)
);

CREATE TABLE team (
	teamId    INT UNSIGNED AUTO_INCREMENT NOT NULL,
	teamSportId INT UNSIGNED              NOT NULL,
	teamApiId VARCHAR(10)                NOT NULL,
	teamName  VARCHAR(32)                 NOT NULL,
	teamCity  VARCHAR(50)                 NOT NULL,
	INDEX (teamApiId),
	INDEX (teamName),
	FOREIGN KEY (teamSportId) REFERENCES sport (sportId),
	PRIMARY KEY (teamId)
);

CREATE TABLE player (
	playerId    INT UNSIGNED AUTO_INCREMENT NOT NULL,
	playerApiId INT UNSIGNED                NOT NULL,
	playerSportId     INT UNSIGNED                NOT NULL,
	playerTeamId      INT UNSIGNED                NOT NULL,
	playerName  VARCHAR(100)                 NOT NULL,
	INDEX (playerApiId),
	UNIQUE (playerId),
	FOREIGN KEY (playerSportId) REFERENCES sport (sportId),
	FOREIGN KEY (playerTeamId) REFERENCES team (teamId),
	PRIMARY KEY (playerId)
);

CREATE TABLE game (
	gameId           INT UNSIGNED AUTO_INCREMENT NOT NULL,
	gameFirstTeamId  INT UNSIGNED                NOT NULL,
	gameSecondTeamId INT UNSIGNED                NOT NULL,
	gameTime         DATETIME                    NOT NULL,
	INDEX (gameFirstTeamId),
	INDEX (gameSecondTeamId),
	FOREIGN KEY (gameFirstTeamId) REFERENCES team (teamId),
	FOREIGN KEY (gameSecondTeamId) REFERENCES team (teamId),
	PRIMARY KEY (gameId)
);

CREATE TABLE favoriteTeam (
	favoriteTeamTeamId    INT UNSIGNED NOT NULL,
	favoriteTeamProfileId INT UNSIGNED NOT NULL,
	INDEX (favoriteTeamTeamId),
	INDEX (favoriteTeamProfileId),
	FOREIGN KEY (favoriteTeamTeamId) REFERENCES team (teamId),
	FOREIGN KEY (favoriteTeamProfileId) REFERENCES profile (profileId),
	PRIMARY KEY (favoriteTeamTeamId,favoriteTeamProfileId)
);

CREATE TABLE favoritePlayer (
	favoritePlayerPlayerId  INT UNSIGNED NOT NULL,
	favoritePlayerProfileId INT UNSIGNED NOT NULL,
	INDEX (favoritePlayerPlayerId),
	INDEX (favoritePlayerProfileId),
	FOREIGN KEY (favoritePlayerPlayerId) REFERENCES player (playerId),
	FOREIGN KEY (favoritePlayerProfileId) REFERENCES profile (profileId),
	PRIMARY KEY (favoritePlayerPlayerId, favoritePlayerProfileId)
);

CREATE TABLE statistic (
	statisticId   INT UNSIGNED AUTO_INCREMENT NOT NULL,
	statisticName VARCHAR(255)                NOT NULL,
	PRIMARY KEY (statisticId)
);

CREATE TABLE teamStatistic (
	teamStatisticGameId      INT UNSIGNED NOT NULL,
	teamStatisticTeamId      INT UNSIGNED NOT NULL,
	teamStatisticStatisticId INT UNSIGNED NOT NULL,
	teamStatisticValue       VARCHAR(250)  NOT NULL,
	INDEX (teamStatisticGameId),
	INDEX (teamStatisticTeamId),
	INDEX (teamStatisticStatisticId),
	FOREIGN KEY (teamStatisticTeamId) REFERENCES team (teamId),
	FOREIGN KEY (teamStatisticStatisticId) REFERENCES statistic (statisticId),
	FOREIGN KEY (teamStatisticGameId) REFERENCES game (gameId)
);

CREATE TABLE playerStatistic (
	playerStatisticGameId                     INT UNSIGNED NOT NULL,
	playerStatisticPlayerId    INT UNSIGNED NOT NULL,
	playerStatisticTeamId      INT UNSIGNED NOT NULL,
	playerStatisticStatisticId INT UNSIGNED NOT NULL,
	playerStatisticValue       VARCHAR(250)  NOT NULL,
	INDEX (playerStatisticPlayerId),
	INDEX (playerStatisticTeamId),
	INDEX (playerStatisticGameId),
	FOREIGN KEY (playerStatisticPlayerId) REFERENCES player (playerId),
	FOREIGN KEY (playerStatisticTeamId) REFERENCES team (teamId),
{'fraction_non_alphanumeric': 0.05911788665192599, 'fraction_numerical': 0.007913417898289305, 'mean_word_length': 3.605573419078242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5032926', 'n_tokens_mistral': 2824, 'n_tokens_neox': 2641, 'n_words': 820}