<commit_before>CREATE TABLE IF NOT EXISTS `team` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `hash` char(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `unlocked_value` int(11),
  `active` boolean NOT NULL default 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `value` int(11) NOT NULL,
  `answer` varchar(40) NOT NULL,
  `description` text,
  `notes` text,
  `author` varchar(40),
  `category_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `answer` (`answer`),
  FOREIGN KEY (`category_id`) REFERENCES category(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle_solved` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `team_id` int(11) NOT NULL,
  `puzzle_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX (`team_id`),
  UNIQUE KEY `solved` (`team_id`, `puzzle_id`),
  FOREIGN KEY (`team_id`) REFERENCES team(`id`),
  FOREIGN KEY (`puzzle_id`) REFERENCES puzzle(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `puzzle_id` int(11) NOT NULL,
  `name` varchar(40) NOT NULL,
  `url` varchar(200) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX (`puzzle_id`),
  UNIQUE KEY `name` (`puzzle_id`, `name`),
  UNIQUE KEY `url` (`puzzle_id`, `url`),
  FOREIGN KEY (`puzzle_id`) REFERENCES puzzle(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

<commit_msg>Change some unique keys.<commit_after>CREATE TABLE IF NOT EXISTS `team` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `hash` char(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY (`name`),
  UNIQUE KEY (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `unlocked_value` int(11),
  `active` boolean NOT NULL default 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `value` int(11) NOT NULL,
  `answer` varchar(40) NOT NULL,
  `description` text,
  `notes` text,
  `author` varchar(40),
  `category_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY (`answer`),
  FOREIGN KEY (`category_id`) REFERENCES category(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle_solved` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `team_id` int(11) NOT NULL,
  `puzzle_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX (`team_id`),
  UNIQUE KEY (`team_id`, `puzzle_id`),
  FOREIGN KEY (`team_id`) REFERENCES team(`id`),
  FOREIGN KEY (`puzzle_id`) REFERENCES puzzle(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `puzzle_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `puzzle_id` int(11) NOT NULL,
  `name` varchar(40) NOT NULL,
  `url` varchar(200) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX (`puzzle_id`),
  UNIQUE KEY (`puzzle_id`, `name`),
  UNIQUE KEY (`puzzle_id`, `url`),
  FOREIGN KEY (`puzzle_id`) REFERENCES puzzle(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


{'fraction_non_alphanumeric': 0.1481931369571819, 'fraction_numerical': 0.026723352566049196, 'mean_word_length': 4.8612099644128115, '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': '4844509', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1297, 'n_words': 380}