---
url: https://docs.nemo12.com/reference/data-dictionary/orca.md
description: >-
  Từ điển dữ liệu D1, domain Orca: 3 bảng, competition_actions tới competitions;
  cột, kiểu, khoá ngoại, index.
---

# Data Dictionary · Orca

> ⚙️ **Trang này sinh tự động** từ source code bằng `scripts/gen-reference.mjs` — đừng sửa tay, sửa code rồi chạy `npm run gen:reference`.

Thuộc [Data Dictionary](../data-dictionary.md). 3 bảng, `competition_actions` tới `competitions`.

## `competition_actions`

migration: `0014_orca_competitions.sql`

| Cột | Kiểu | Ràng buộc / ghi chú |
| --- | --- | --- |
| `learner_id` | TEXT | NOT NULL REFERENCES learners(id) |
| `competition_id` | TEXT | NOT NULL REFERENCES competitions(id) |
| `edition_id` | TEXT | , state TEXT NOT NULL CHECK (state IN ('saved','interested','plan_to_join','registered','preparing','participated','completed','awarded','skipped')) |
| `result` | TEXT | , score TEXT, ranking TEXT, award TEXT, reflection TEXT |
| `updated_at` | TEXT | NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')) |
| — | *table constraint* | `PRIMARY KEY (learner_id, competition_id)` |

**Khóa ngoại:** `learner_id` → `learners` · `competition_id` → `competitions`

## `competition_editions`

migration: `0014_orca_competitions.sql`

| Cột | Kiểu | Ràng buộc / ghi chú |
| --- | --- | --- |
| `id` | TEXT | PRIMARY KEY, competition_id TEXT NOT NULL REFERENCES competitions(id) |
| `year` | INTEGER | NOT NULL, registration_deadline TEXT, competition_date TEXT, results_date TEXT |
| `location` | TEXT | , notes TEXT, status TEXT NOT NULL DEFAULT 'upcoming' |

**Khóa ngoại:** `id` → `competitions`

**Index:** `idx_editions`(competition_id, year)

## `competitions`

Migration 0014 — Orca Competition Hub. SDD-016 §1, REQ-ORC-01/05 (SRC-044).

migration: `0014_orca_competitions.sql`

| Cột | Kiểu | Ràng buộc / ghi chú |
| --- | --- | --- |
| `id` | TEXT | PRIMARY KEY, name TEXT NOT NULL, name_vi TEXT, organizer TEXT, domain TEXT NOT NULL |
| `subject_id` | TEXT | , grade_min INTEGER, grade_max INTEGER, geography TEXT, mode TEXT |
| `level` | TEXT | NOT NULL, intensity INTEGER NOT NULL DEFAULT 2 CHECK (intensity BETWEEN 1 AND 5) |
| `format` | TEXT | , team TEXT DEFAULT 'individual', fee_note TEXT, website TEXT, description TEXT |
| `required_capabilities_json` | TEXT | , prestige INTEGER, awards_note TEXT, qualification_note TEXT |
| `verified` | INTEGER | NOT NULL DEFAULT 0, status TEXT NOT NULL DEFAULT 'active', source_ref TEXT |
| `created_at` | TEXT | NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')) |

**Index:** `idx_competitions`(domain, level, status)
