Spec Kit Component: database
Responsibilitiesβ
- Host H2 database runtime for baseline services.
- Provide seeded account, trade, position, and account-user data.
- Expose TCP/PG/Web console ports for service access and local inspection.
Covered Flowsβ
Requirement Coverageβ
Verificationβ
scripts/test-database-overlay.sh
Connection retirement and existing databases (#461)β
The H2 schema uses CASE for Trades.Side/State and OrderBook.Side/Status checks.
Do not regenerate literal IN-list checks: H2 2.4.240 can retain the closed schema
session's comparator. Invalid values must still fail and NULL remains allowed.
templates/database-specfirst/src/test/java/SchemaConnectionRetirementTest.java
executes the canonical schema and validates all allowed values after creator closure.
Existing persistent databases require a backed-up constraint migration; regeneration
alone does not alter their constraints. Never run the destructive initial schema to
repair an existing database. See docs/operations/h2-booking-constraint-migration.md.