hackathon/models/xo.xo.yaml

207 lines
4.0 KiB
YAML

---
# Generated by xo.
schemas:
- type: sqlite3
name: db.sqlite
tables:
- type: table
name: question_attempt
columns:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
- name: user_id
datatype:
type: text
- name: question_id
datatype:
type: text
- name: question_part
datatype:
type: integer
- name: correct
datatype:
type: boolean
- name: points_awarded
datatype:
type: integer
- name: answer
datatype:
type: text
- name: code
datatype:
type: text
- name: submitted_at
datatype:
type: datetime
primary_keys:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
indexes:
- name: question_attempt_id_pkey
fields:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
is_unique: true
is_primary: true
foreign_keys:
- name: question_attempt_user_id_fkey
column:
- name: user_id
datatype:
type: text
ref_table: users
ref_column:
- name: id
datatype:
type: text
is_primary: true
- type: table
name: tokens
columns:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
- name: token
datatype:
type: text
- name: user_id
datatype:
type: text
- name: created_at
datatype:
type: datetime
primary_keys:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
indexes:
- name: sqlite_autoindex_tokens_1
fields:
- name: token
datatype:
type: text
is_unique: true
- name: user_tokens
fields:
- name: user_id
datatype:
type: text
- name: tokens_id_pkey
fields:
- name: id
datatype:
type: integer
is_primary: true
is_sequence: true
is_unique: true
is_primary: true
foreign_keys:
- name: tokens_user_id_fkey
column:
- name: user_id
datatype:
type: text
ref_table: users
ref_column:
- name: id
datatype:
type: text
is_primary: true
- type: table
name: user_info
columns:
- name: user_id
datatype:
type: text
is_primary: true
- name: grade_level
datatype:
type: integer
- name: skill_level
datatype:
type: integer
primary_keys:
- name: user_id
datatype:
type: text
is_primary: true
indexes:
- name: sqlite_autoindex_user_info_1
fields:
- name: user_id
datatype:
type: text
is_primary: true
is_unique: true
is_primary: true
foreign_keys:
- name: user_info_user_id_fkey
column:
- name: user_id
datatype:
type: text
is_primary: true
ref_table: users
ref_column:
- name: id
datatype:
type: text
is_primary: true
manual: true
- type: table
name: users
columns:
- name: id
datatype:
type: text
is_primary: true
- name: name
datatype:
type: text
- name: email
datatype:
type: text
- name: picture
datatype:
type: text
- name: admin
datatype:
type: boolean
- name: created_at
datatype:
type: datetime
primary_keys:
- name: id
datatype:
type: text
is_primary: true
indexes:
- name: sqlite_autoindex_users_1
fields:
- name: id
datatype:
type: text
is_primary: true
is_unique: true
is_primary: true
- name: sqlite_autoindex_users_2
fields:
- name: email
datatype:
type: text
is_unique: true
manual: true