<commit_before>DROP DATABASE IF EXISTS `fbdev`;
CREATE DATABASE `fbdev`;
USE `fbdev`;

-- INIT

CREATE TABLE `Users` (
	facebookId varchar(250) NOT NULL,
	firstName varchar(250) NOT NULL,
	lastName varchar(250) NOT NULL,
	email varchar(250) NOT NULL,
	birth DATETIME,
	gender varchar(250),
	token varchar(250),
	PRIMARY KEY (facebookId)
);

CREATE TABLE `Contests` (
	contestId int NOT NULL AUTO_INCREMENT,
	name varchar(250),
	startDate DATETIME NOT NULL,
	endDate DATETIME NOT NULL,
	prize varchar(250),
	status BOOLEAN NOT NULL,
	createdAt DATETIME NOT NULL,
	createdBy varchar(250) NOT NULL,
	PRIMARY KEY (contestId),
	FOREIGN KEY (prize) REFERENCES Prizes(prizeId),
	FOREIGN KEY (createdBy) REFERENCES Users(facebookId)
);

CREATE TABLE `Photos` (
	photoId int NOT NULL AUTO_INCREMENT,
	contest int NOT NULL,
	facebookUrl varchar(250) NOT NULL,
	createdAt DATETIME NOT NULL,
	createdBy varchar(250) NOT NULL,
	PRIMARY KEY (photoId),
	FOREIGN KEY (contest) REFERENCES Contests(contestId),
	FOREIGN KEY (createdBy) REFERENCES Users(facebookId)
);

CREATE TABLE `Votes` (
	user varchar(250) NOT NULL,
	photo int NOT NULL,
	createdAt DATETIME NOT NULL,
	PRIMARY KEY (user, photo),
	FOREIGN KEY (photo) REFERENCES Photos(photoId),
	FOREIGN KEY (user) REFERENCES Users(facebookId)
);

-- INSERT
<commit_msg>remove prize constraint<commit_after>DROP DATABASE IF EXISTS `fbdev`;
CREATE DATABASE `fbdev`;
USE `fbdev`;

-- INIT

CREATE TABLE `Users` (
	facebookId varchar(250) NOT NULL,
	firstName varchar(250) NOT NULL,
	lastName varchar(250) NOT NULL,
	email varchar(250) NOT NULL,
	birth DATETIME,
	gender varchar(250),
	token varchar(250),
	PRIMARY KEY (facebookId)
);

CREATE TABLE `Contests` (
	contestId int NOT NULL AUTO_INCREMENT,
	name varchar(250),
	startDate DATETIME NOT NULL,
	endDate DATETIME NOT NULL,
	prize varchar(250),
	status BOOLEAN NOT NULL,
	createdAt DATETIME NOT NULL,
	createdBy varchar(250) NOT NULL,
	PRIMARY KEY (contestId),
	FOREIGN KEY (createdBy) REFERENCES Users(facebookId)
);

CREATE TABLE `Photos` (
	photoId int NOT NULL AUTO_INCREMENT,
	contest int NOT NULL,
	facebookUrl varchar(250) NOT NULL,
	createdAt DATETIME NOT NULL,
	createdBy varchar(250) NOT NULL,
	PRIMARY KEY (photoId),
	FOREIGN KEY (contest) REFERENCES Contests(contestId),
	FOREIGN KEY (createdBy) REFERENCES Users(facebookId)
);

CREATE TABLE `Votes` (
	user varchar(250) NOT NULL,
	photo int NOT NULL,
	createdAt DATETIME NOT NULL,
	PRIMARY KEY (user, photo),
	FOREIGN KEY (photo) REFERENCES Photos(photoId),
	FOREIGN KEY (user) REFERENCES Users(facebookId)
);

-- INSERT

{'fraction_non_alphanumeric': 0.09288767975126312, 'fraction_numerical': 0.027982899339292655, 'mean_word_length': 5.355555555555555, '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': '6558835', 'n_tokens_mistral': 1022, 'n_tokens_neox': 910, 'n_words': 299}