[Phase 3.2] PostgreSQL Schema for Accounts, ScannedCreatureInstance Offsets & Decks #12

Open
opened 2026-11-17 06:12:21 +00:00 by john4064 · 0 comments
Owner

Goal

Stand up idempotent PostgreSQL migrations (deploy/sql/) and repository layer storing accounts, rolled ScannedCreatureInstance offsets, and validated 5-deck loadouts.

Metadata

  • Phase / Step: Phase 3.2
  • Depends On: #4, #27
  • Unlocks: #1, #16, #29, #36, #41
  • Target Crates / Paths: deploy/sql/, .forgejo/workflows/db_migration.yml, DB repository module
  • Line Budget Plan: Production .rs <= 400 lines, test .rs <= 600 lines, mod.rs < 80 lines (AGENTS.md Section 2.3)

Acceptance Criteria

  • Define idempotent SQL migrations (deploy/sql/) with CHECK constraints enforcing energy_offset IN (-5, 0, 5) and discipline offsets in (-10, -5, 0, 5, 10).
  • Verify zero SQL table drift against scripts/bug_hunter.py Pillar 3 (CREATE TABLE vs queries).
  • Reinstate clean CI SQL migration verification against ephemeral postgres:16-alpine without swallowed DB errors.
  • Validate saved 5-deck loadouts through chaotic_core 5-deck validator before persisting.
## Goal Stand up idempotent PostgreSQL migrations (`deploy/sql/`) and repository layer storing accounts, rolled `ScannedCreatureInstance` offsets, and validated 5-deck loadouts. ## Metadata - **Phase / Step:** Phase 3.2 - **Depends On:** #4, #27 - **Unlocks:** #1, #16, #29, #36, #41 - **Target Crates / Paths:** `deploy/sql/`, `.forgejo/workflows/db_migration.yml`, DB repository module - **Line Budget Plan:** Production `.rs` <= 400 lines, test `.rs` <= 600 lines, `mod.rs` < 80 lines (`AGENTS.md` Section 2.3) ## Acceptance Criteria - [ ] Define idempotent SQL migrations (`deploy/sql/`) with CHECK constraints enforcing `energy_offset IN (-5, 0, 5)` and discipline offsets in `(-10, -5, 0, 5, 10)`. - [ ] Verify zero SQL table drift against `scripts/bug_hunter.py` Pillar 3 (`CREATE TABLE` vs queries). - [ ] Reinstate clean CI SQL migration verification against ephemeral `postgres:16-alpine` without swallowed DB errors. - [ ] Validate saved 5-deck loadouts through `chaotic_core` 5-deck validator before persisting.
Sign in to join this conversation.
No description provided.