diff --git a/docs/database/challenges.md b/docs/database/challenges.md index 9b4b90b..8164b55 100644 --- a/docs/database/challenges.md +++ b/docs/database/challenges.md @@ -3,7 +3,7 @@ type: database title: Challenge Tables description: category, challenge, challenge_file, and solve tables — how CTF challenges and scoring are stored. tags: [database, challenge, category, solve] -timestamp: 2026-07-21T14:18:00Z +timestamp: 2026-07-22T14:50:25Z --- # Tables @@ -18,8 +18,8 @@ timestamp: 2026-07-21T14:18:00Z | `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/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`). | +| `created_at` | TEXT | ISO 8601 timestamp the row was created. Declared in the initial `InitSchema1700000000000` migration (defaulting to `strftime('%Y-%m-%dT%H:%M:%fZ','now')`); the `AddCategoryTimestampsAndUniqueAbbrev1700000000200` migration adds it as a no-op for older pre-existing databases. | +| `updated_at` | TEXT | ISO 8601 timestamp the row was last updated (bumped on `PUT /api/v1/admin/categories/:id`). Same provenance as `created_at`. | System rows are seeded by the `UpdateSystemCategoryKeys1700000000300` migration so the canonical diff --git a/docs/database/schema.md b/docs/database/schema.md index a9ae386..a2f2f07 100644 --- a/docs/database/schema.md +++ b/docs/database/schema.md @@ -3,7 +3,7 @@ type: database title: Database Schema Overview description: SQLite (better-sqlite3) schema for HIPCTF: tables, relationships, indexes, and WAL journal mode. tags: [database, sqlite, typeorm, schema] -timestamp: 2026-07-21T14:18:00Z +timestamp: 2026-07-22T14:50:25Z --- # Overview @@ -17,6 +17,12 @@ The schema is created by a single migration (`backend/src/database/migrations/1700000000000-InitSchema.ts`) and seeded by a second migration (`backend/src/database/migrations/1700000000100-SeedSystemData.ts`). +The initial migration declares every column used by the entities +(including `category.created_at` and `category.updated_at`), so the +later `AddCategoryTimestampsAndUniqueAbbrev1700000000200` and +`UpdateSystemCategoryKeys1700000000300` migrations only patch legacy +databases that pre-date those columns and reseed the canonical system +rows. # Tables diff --git a/docs/guides/admin-general-settings.md b/docs/guides/admin-general-settings.md index 02f081d..df3f3b3 100644 --- a/docs/guides/admin-general-settings.md +++ b/docs/guides/admin-general-settings.md @@ -3,7 +3,7 @@ type: guide title: Admin — General Settings description: How an admin edits required platform-wide settings, including the validated event window, from the /admin/general page. tags: [guide, admin, settings, general, tester, datetime, validation] -timestamp: 2026-07-22T14:24:08Z +timestamp: 2026-07-22T14:50:25Z --- # When this view is available @@ -17,7 +17,7 @@ by navigating directly to the URL. |------------------|----------------------------------------------------------------------------|------------------------------------------------| | Client route | `frontend/src/app/app.routes.ts` | `/admin/general` child of `adminGuard`. | | Client component | `frontend/src/app/features/admin/general.component.ts` | `AdminGeneralComponent.ngOnInit` fetches settings + themes. | -| Client predicate | `frontend/src/app/features/admin/general.pure.ts` (`deriveEventState`, `pageTitleError`, `pageTitleMessage`) | Pure helpers for event-state derivation and Page-title error/message mapping. | +| Client predicate | `frontend/src/app/features/admin/general.pure.ts` (`deriveEventState`, `pageTitleError`, `pageTitleMessage`, `eventEndFieldMessage`) | Pure helpers for event-state derivation, Page-title error/message mapping, and the merged Event End field message (per-field `invalidDatetime` + cross-field `endBeforeStart`). | | Server route | `backend/src/modules/admin/admin-general.controller.ts` | `GET/PUT /api/v1/admin/general/settings` + `GET /api/v1/admin/general/themes`. | # How to access (tester steps) @@ -43,7 +43,7 @@ The page is a single reactive form with these controls (every | Logo upload status | `general-logo-uploading` / `general-logo-error` / `general-logo-current` | — | Inline status text under the file picker. | | Global theme | `general-themeKey` | `themeKey` | `