<commit_before>{-# LANGUAGE QuasiQuotes #-}
module Lycopene.Core.Database.Schema
                ( schema
                ) where

import           Lycopene.Core.TH

schema :: String
schema = [str|
CREATE TABLE project (
  project_id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL UNIQUE,
  description TEXT
);

CREATE TABLE sprint (
  sprint_id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  description TEXT,
  project_id INTEGER,
  start_on INTEGER,
  end_on INTEGER,
  FOREIGN KEY(project_id) REFERENCES project(project_id)
);

CREATE TABLE issue (
  issue_id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,
  description TEXT,
  sprint_id INTEGER,
  status INTEGER NOT NULL,
  FOREIGN KEY(sprint_id) REFERENCES sprint(sprint_id)
);

CREATE TABLE record (
  record_id INTEGER PRIMARY KEY AUTOINCREMENT,
  issue_id INTEGER,
  start_on INTEGER,
  end_on INTEGER,
  FOREIGN KEY(issue_id) REFERENCES issue(issue_id)
);
|]<commit_msg>primary key should be not null<commit_after>{-# LANGUAGE QuasiQuotes #-}
module Lycopene.Core.Database.Schema
                ( schema
                ) where

import           Lycopene.Core.TH

schema :: String
schema = [str|
CREATE TABLE project (
  project_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  name TEXT NOT NULL UNIQUE,
  description TEXT
);

CREATE TABLE sprint (
  sprint_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  name TEXT NOT NULL,
  description TEXT,
  project_id INTEGER,
  start_on INTEGER,
  end_on INTEGER,
  FOREIGN KEY(project_id) REFERENCES project(project_id)
);

CREATE TABLE issue (
  issue_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  title TEXT NOT NULL,
  description TEXT,
  sprint_id INTEGER,
  status INTEGER NOT NULL,
  FOREIGN KEY(sprint_id) REFERENCES sprint(sprint_id)
  FOREIGN KEY(status) REFERENCES issue_status(status_id)
);

CREATE TABLE record (
  record_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  issue_id INTEGER,
  start_on INTEGER,
  end_on INTEGER,
  FOREIGN KEY(issue_id) REFERENCES issue(issue_id)
);

CREATE TABLE issue_status (
  status_id INTEGER PRIMARY KEY NOT NULL,
  status_name INTEGER NOT NULL
);
|]
{'fraction_non_alphanumeric': 0.06346243583761083, 'fraction_numerical': 0.0, 'mean_word_length': 3.807174887892377, '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': '112539', 'n_tokens_mistral': 759, 'n_tokens_neox': 690, 'n_words': 218}