AI Implementation feature(882): Admin Area General Settings and Categories 1.00 (#22)
This commit was merged in pull request #22.
This commit is contained in:
@@ -13,14 +13,26 @@ timestamp: 2026-07-21T14:18:00Z
|
||||
| Column | Type | Description |
|
||||
|----------------|---------|------------------------------------------------------------------------------|
|
||||
| `id` | TEXT PK | UUID v4. |
|
||||
| `system_key` | TEXT | One of `crypto`, `forensics`, `pwn`, `web`, `misc`, `osint` (unique where NOT NULL) or `NULL` for user-created categories. |
|
||||
| `system_key` | TEXT | Non-null for system categories (e.g. `CRY`, `MSC`, `PWN`, `REV`, `WEB`, `HW`); unique where NOT NULL; `NULL` for user-created categories. |
|
||||
| `name` | TEXT | Display name (e.g. `Cryptography`). |
|
||||
| `abbreviation` | TEXT | Short label (e.g. `CRY`). |
|
||||
| `abbreviation` | TEXT | Short label (e.g. `CRY`), 2–6 chars, server-uppercased. Globally unique — enforced by `uq_category_abbreviation`. |
|
||||
| `description` | TEXT | Optional description. |
|
||||
| `icon_path` | TEXT | Default icon URL (e.g. `/uploads/icons/crypto.svg`). |
|
||||
| `icon_path` | TEXT | Default icon URL (e.g. `/uploads/icons/CRY.png`). |
|
||||
| `created_at` | TEXT | ISO 8601 timestamp the row was created (added by `AddCategoryTimestampsAndUniqueAbbrev1700000000200`). |
|
||||
| `updated_at` | TEXT | ISO 8601 timestamp the row was last updated (added by the same migration; bumped on `PUT /api/v1/admin/categories/:id`). |
|
||||
|
||||
The seed migration inserts one row per `SYSTEM_CATEGORY_KEYS` value from
|
||||
`backend/src/config/env.schema.ts`.
|
||||
System rows are seeded by the
|
||||
`UpdateSystemCategoryKeys1700000000300` migration so the canonical
|
||||
keys are `CRY` (Cryptography), `MSC` (Misc), `PWN` (Binary
|
||||
exploitation), `REV` (Reverse Engineering), `WEB` (Web), and `HW`
|
||||
(Hardware). The migration drops any legacy seeded rows that no
|
||||
longer match the canonical set before inserting the missing entries.
|
||||
User-created categories leave `system_key` as `NULL`.
|
||||
|
||||
The uniqueness on `abbreviation` is enforced both by application
|
||||
validation (uppercased on save, duplicates rejected) and by the
|
||||
`uq_category_abbreviation` index created in migration
|
||||
`1700000000200`.
|
||||
|
||||
## `challenge`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user