
--
-- Sqlite SQL Schema dump automatic generated by geni
--

CREATE TABLE schema_migrations (id VARCHAR(255) PRIMARY KEY);
CREATE TABLE users (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  username TEXT NOT NULL UNIQUE,
  password TEXT NOT NULL
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE mail (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  user_id INTEGER NOT NULL,
  mail TEXT NOT NULL UNIQUE,
  validation_code TEXT NOT NULL UNIQUE,
  is_validated BOOLEAN NOT NULL DEFAULT 0,
  is_primary BOOLEAN NOT NULL DEFAULT 0,

  FOREIGN KEY(user_id) REFERENCES users(id)
);