AI Implementation feature(893): Admin Area General Settings and Categories 1.11 (#33)

This commit was merged in pull request #33.
This commit is contained in:
2026-07-22 16:46:01 +00:00
parent c0a01eb58e
commit 56555d272f
13 changed files with 566 additions and 104 deletions
+10 -5
View File
@@ -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-22T14:50:25Z
timestamp: 2026-07-22T16:44:54Z
---
# Overview
@@ -19,10 +19,15 @@ 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.
later `AddCategoryTimestampsAndUniqueAbbrev1700000000200`,
`UpdateSystemCategoryKeys1700000000300`, and
`RepairCategorySchemaAndSystemCategories1700000000400` migrations only
patch legacy databases that pre-date those columns and reseed the
canonical system rows. The `...0400` migration is idempotent and
forward-only: it adds `created_at`/`updated_at` to legacy six-column
`category` tables, deletes obsolete `FOR`/`OSI` system rows, rewrites
metadata on canonical rows, inserts any missing canonical row, and
re-asserts the unique indexes on `system_key` and `abbreviation`.
# Tables