scratch-online-judge

Tables (7)

judgement (Untitled5)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • upload_id (Key2) — SERIAL — Foreign key → upload.id — NOT NULL
  • problem_id (Key3) — SERIAL — Foreign key → upload.problem_id — NOT NULL
  • result (Field) — VARCHAR(20) — NOT NULL — OK, Wrong Answer, Timeout
  • memory_usage (Field2) — INTEGER — NOT NULL — Number of variables + Sum of list lengths

problem (Untitled6)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • title (Field) — VARCHAR(255) — NOT NULL
  • describe_problem (text) — TEXT — NOT NULL — Markdown
  • describe_input (Field2) — TEXT — NOT NULL — Markdown
  • describe_output (Field3) — TEXT — NOT NULL — Markdown

problem_example (Untitled7)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • problem_id (Key2) — SERIAL — Foreign key → problem.id — NOT NULL
  • input (Field) — TEXT — Markdown
  • output (Field2) — TEXT — Markdown

role (Untitled2)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • authority (Field) — VARCHAR(255) — NOT NULL

upload (Untitled4)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • owner_id (Key2) — SERIAL — Foreign key → user.id — NOT NULL
  • problem_id (Key3) — SERIAL — Foreign key → problem.id — NOT NULL
  • file_path (Field) — VARCHAR(255) — NOT NULL — Relative path

user (Untitled)

  • id (Key) — SERIAL — Primary key — NOT NULL
  • pw (Field2) — VARCHAR(255) — NOT NULL — Hash value
  • name (Field) — VARCHAR(16) — NOT NULL
  • expired (Field3) — BOOLEAN — NOT NULL
  • created_at (Field4) — TIMESTAMP — NOT NULL

user_role (Untitled3)

  • user_id (Key) — SERIAL — Foreign key → user.id — NOT NULL
  • role_id (Key2) — SERIAL — Foreign key → role.id — NOT NULL