<commit_before>CREATE TYPE Currency AS ENUM (
  'CHF',
  'EUR'
);

CREATE TYPE TransactionType AS ENUM (
  'EXPENSE',
  'COMPENSATION'
);

CREATE TABLE IF NOT EXISTS "group" (
  uuid  VARCHAR(50),
  name  VARCHAR(50) NOT NULL,
  currency  Currency NOT NULL,
  PRIMARY KEY (uuid)
);

CREATE TABLE IF NOT EXISTS "person" (
  id  SERIAL,
  name  VARCHAR(50) NOT NULL,
  groupUuid VARCHAR(50) NOT NULL REFERENCES "group",
  PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS "transaction" (
  id  SERIAL,
  title VARCHAR(50) NOT NULL,
  amount INTEGER NOT NULL,
  createTime TIMESTAMP WITH TIME ZONE NOT NULL,
  updateTime TIMESTAMP WITH TIME ZONE NOT NULL,
  transactionType TransactionType NOT NULL,
  payerId INTEGER NOT NULL REFERENCES "person",
  PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS "profiteer" (
  personId INTEGER REFERENCES "person",
  transactionId INTEGER REFERENCES "transaction",
  factor DECIMAL(5) NOT NULL,
  PRIMARY KEY (personId, transactionId)
);<commit_msg>Fix Demian's suggestions<commit_after>CREATE TYPE currency AS ENUM (
  'chf',
  'eur'
);

CREATE TYPE transaction_type AS ENUM (
  'expense',
  'compensation'
);

CREATE TABLE IF NOT EXISTS "group" (
  "id"  VARCHAR(50),
  "name"  VARCHAR(50) NOT NULL,
  "currency"  currency NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE IF NOT EXISTS "person" (
  "id"  SERIAL,
  "name"  VARCHAR(50) NOT NULL,
  "group" VARCHAR(50) NOT NULL REFERENCES "group",
  PRIMARY KEY ("id")
);

CREATE TABLE IF NOT EXISTS "transaction" (
  "id"  SERIAL,
  "title" VARCHAR(50) NOT NULL,
  "amount" INTEGER NOT NULL,
  "createTime" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
  "updateTime" TIMESTAMP WITH TIME ZONE NOT NULL,
  "type" transaction_type NOT NULL,
  "payer" INTEGER NOT NULL REFERENCES "person",
  PRIMARY KEY ("id")
);

CREATE TABLE IF NOT EXISTS "profiteer" (
  "person" INTEGER REFERENCES "person",
  "transaction" INTEGER REFERENCES "transaction",
  "factor" DECIMAL(5) NOT NULL,
  PRIMARY KEY ("person", "transaction")
);
{'fraction_non_alphanumeric': 0.1063936063936064, 'fraction_numerical': 0.01098901098901099, 'mean_word_length': 4.2297650130548305, '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': '3810620', 'n_tokens_mistral': 736, 'n_tokens_neox': 685, 'n_words': 242}