<commit_before># =========================================================================== #
#                                                                             #
# TRANZIT - Database Initialization Script                                    #
# Copyright © Contributors. See docs/charter.md for team roster.              #
#                                                                             #
# =========================================================================== #
CREATE TABLE IF NOT EXISTS users (
  `id`          VARCHAR(20) NOT NULL,
  `first_name`  VARCHAR(50) NOT NULL,
  `last_name`   VARCHAR(50) NOT NULL,
  `uname`       VARCHAR(50) NOT NULL  UNIQUE,
  `hash`        TEXT        NOT NULL,
  `auth`        TEXT        NOT NULL,
  PRIMARY KEY (id),
  INDEX users_uname (uname)
);

CREATE TABLE IF NOT EXISTS recipients (
  `id`          VARCHAR(20) NOT NULL,
  `first_name`  VARCHAR(50) NOT NULL,
  `last_name`   VARCHAR(50) NOT NULL,
  PRIMARY KEY (id),
  INDEX recipients_name (first_name, last_name)
);

CREATE TABLE IF NOT EXISTS packages (
  `id`          VARCHAR(20) NOT NULL,
  `tracking`    VARCHAR(100) NOT NULL,
  `received`    DATETIME    NOT NULL,
  `recipient`   VARCHAR(20) NOT NULL,
  `released`    DATETIME    DEFAULT NULL,
  `user`        VARCHAR(20) NOT NULL,
  PRIMARY KEY (id),
  INDEX packages_tracking (tracking),
  FOREIGN KEY (recipient) REFERENCES recipients(id) ON DELETE CASCADE,
  FOREIGN KEY (user) REFERENCES users(id) ON DELETE SET NULL
);<commit_msg>Foreign keys not working... why?<commit_after># =========================================================================== #
#                                                                             #
# TRANZIT - Database Initialization Script                                    #
# Copyright © Contributors. See docs/charter.md for team roster.              #
#                                                                             #
# =========================================================================== #
CREATE TABLE IF NOT EXISTS users (
  `id`          VARCHAR(20) NOT NULL,
  `first_name`  VARCHAR(50) NOT NULL,
  `last_name`   VARCHAR(50) NOT NULL,
  `uname`       VARCHAR(50) NOT NULL  UNIQUE,
  `hash`        TEXT        NOT NULL,
  `auth`        TEXT        NOT NULL,
  PRIMARY KEY (id),
  INDEX users_uname (uname)
);

CREATE TABLE IF NOT EXISTS recipients (
  `id`          VARCHAR(20) NOT NULL,
  `first_name`  VARCHAR(50) NOT NULL,
  `last_name`   VARCHAR(50) NOT NULL,
  PRIMARY KEY (id),
  INDEX recipients_name (first_name, last_name)
);

CREATE TABLE IF NOT EXISTS packages (
  `id`          VARCHAR(20) NOT NULL,
  `tracking`    VARCHAR(100) NOT NULL,
  `received`    DATETIME    NOT NULL,
  `recipient`   VARCHAR(20) NOT NULL,
  `released`    DATETIME    DEFAULT NULL,
  `user`        VARCHAR(20) NOT NULL,
  PRIMARY KEY (id),
  INDEX packages_tracking (tracking)
);
{'fraction_non_alphanumeric': 0.18467852257181944, 'fraction_numerical': 0.01573187414500684, 'mean_word_length': 2.012358393408857, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3170541', 'n_tokens_mistral': 879, 'n_tokens_neox': 783, 'n_words': 243}