<commit_before>
-- DreamGuild.eu database schema


BEGIN;


CREATE TABLE user (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,
  email      TEXT NOT NULL UNIQUE,
  password   TEXT NOT NULL,

  -- user level
  -- 0: just registered didn't send any app
  -- 1: blank account
  -- 5: guild member
  -- 20: gm
  -- 30: admin
  level      INTEGER DEFAULT 0,     -- user level
  main       INTEGER DEFAULT 0,     -- main character id
  appid      INTEGER DEFAULT 0,     -- aplication id
  dkp        INTEGER DEFAULT 0,
  join_time  INTEGER DEFAULT 0,     -- joined date
  last_active INTEGER DEFAULT 0,
  theme      INTEGER DEFAULT 0
);


CREATE TABLE roster (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,
  name       TEXT,
  uid        INTEGER DEFAULT 0,
  class      INTEGER DEFAULT 0,
  race       INTEGER DEFAULT 0,
  level      INTEGER DEFAULT 0,
  ailvl      INTEGER DEFAULT 0,
  eilvl      INTEGER DEFAULT 0,
  rank       INTEGER DEFAULT 0,
  thumbnail  TEXT,
  spec       TEXT,
  role       INTEGER DEFAULT 0,
  talents    TEXT,
  items      TEXT,
  progress   TEXT,
  achievement_points INTEGER DEFAULT 0,
  last_update INTEGER DEFAULT 0,
  is_main        INTEGER DEFAULT 0,
  lottery_ticket INTEGER DEFAULT 0,
  realm      TEXT NOT NULL
);


CREATE TABLE ilvl_history (
  cid        INTEGER DEFAULT 0,
  ilvl       INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, ilvl)
);


CREATE TABLE progress_history (
  cid        INTEGER DEFAULT 0,
  points     INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, points)
);


CREATE TABLE achievements_point_history (
  cid        INTEGER DEFAULT 0,
  points     INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, points)
);


CREATE TABLE log (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,

  -- LOG TYPES: log.type
  --<commit_msg>add lvl_history table<commit_after>
-- DreamGuild.eu database schema


BEGIN;


CREATE TABLE user (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,
  email      TEXT NOT NULL UNIQUE,
  password   TEXT NOT NULL,

  -- user level
  -- 0: just registered didn't send any app
  -- 1: blank account
  -- 5: guild member
  -- 20: gm
  -- 30: admin
  level      INTEGER DEFAULT 0,     -- user level
  main       INTEGER DEFAULT 0,     -- main character id
  appid      INTEGER DEFAULT 0,     -- aplication id
  dkp        INTEGER DEFAULT 0,
  join_time  INTEGER DEFAULT 0,     -- joined date
  last_active INTEGER DEFAULT 0,
  theme      INTEGER DEFAULT 0
);


CREATE TABLE roster (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,
  name       TEXT,
  uid        INTEGER DEFAULT 0,
  class      INTEGER DEFAULT 0,
  race       INTEGER DEFAULT 0,
  level      INTEGER DEFAULT 0,
  ailvl      INTEGER DEFAULT 0,
  eilvl      INTEGER DEFAULT 0,
  rank       INTEGER DEFAULT 0,
  thumbnail  TEXT,
  spec       TEXT,
  role       INTEGER DEFAULT 0,
  talents    TEXT,
  items      TEXT,
  progress   TEXT,
  achievement_points INTEGER DEFAULT 0,
  last_update INTEGER DEFAULT 0,
  is_main        INTEGER DEFAULT 0,
  lottery_ticket INTEGER DEFAULT 0,
  realm      TEXT NOT NULL
);


CREATE TABLE lvl_history (
  cid        INTEGER DEFAULT 0,
  ilvl       INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, ilvl)
);


CREATE TABLE ilvl_history (
  cid        INTEGER DEFAULT 0,
  ilvl       INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, ilvl)
);


CREATE TABLE progress_history (
  cid        INTEGER DEFAULT 0,
  points     INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, points)
);


CREATE TABLE achievements_point_history (
  cid        INTEGER DEFAULT 0,
  points     INTEGER DEFAULT 0,
  time       INTEGER DEFAULT 0,
  UNIQUE     (cid, points)
);


CREATE TABLE log (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,

  -- LOG TYPES: log.type
  --
{'fraction_non_alphanumeric': 0.05533904910366329, 'fraction_numerical': 0.018965965185762535, 'mean_word_length': 2.0410742496050553, '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': '82618', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1190, 'n_words': 450}