-
Notifications
You must be signed in to change notification settings - Fork 0
Switch PG to wxyc-postgres image; add F0000 precheck to migration 0003 #41
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingconcern:schema-migrationPR ships a Drizzle / sqlx / alembic migrationPR ships a Drizzle / sqlx / alembic migrationcross-cache-identityProject tag for the cross-cache-identity initiative (library hook + identity record + normalization)Project tag for the cross-cache-identity initiative (library hook + identity record + normalization)epic:e3-normalizationParent epic E3 — standardize and document the normalization functionParent epic E3 — standardize and document the normalization functionphase:0Phase 0 — prerequisites (audits, schema bumps, doc prereqs)Phase 0 — prerequisites (audits, schema bumps, doc prereqs)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingconcern:schema-migrationPR ships a Drizzle / sqlx / alembic migrationPR ships a Drizzle / sqlx / alembic migrationcross-cache-identityProject tag for the cross-cache-identity initiative (library hook + identity record + normalization)Project tag for the cross-cache-identity initiative (library hook + identity record + normalization)epic:e3-normalizationParent epic E3 — standardize and document the normalization functionParent epic E3 — standardize and document the normalization functionphase:0Phase 0 — prerequisites (audits, schema bumps, doc prereqs)Phase 0 — prerequisites (audits, schema bumps, doc prereqs)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Todo
Problem
The
CREATE TEXT SEARCH DICTIONARY wxyc_unaccentstep inmigrations/0003_wxyc_identity_match_functions.sqlrequireswxyc_unaccent.rulesto be present at$SHAREDIR/tsearch_data/on the destination PG. Today, CI provisions this viadocker cpinto thepostgres:16-alpineservice container; production Railway PG has no provisioning step inrebuild-cache.yml. The nextworkflow_dispatchrun against a fresh Railway PG will fail atsqlx migrate runwithConfigFileError.Sibling defect to WXYC/discogs-etl#223. Closed deploy ticket #37 was a paper tiger — the migration applied via CI but the production Railway destination has never been exercised against a fresh DB. Verified 2026-05-20 (against
postgres:16-alpine):/usr/local/share/postgresql/tsearch_data/isroot:root 0755, so no in-migration write strategy can self-provision the file. SQLSTATE for the missing-rules-file error isF0000(config_file_error).Desired end state
Switch local + production PG to the new
ghcr.io/wxyc/wxyc-postgres:pg16image (built + published by WXYC/wxyc-etl — see the blocking issue, filed alongside this one). Migration 0003 gets a fail-fast precheck for SQLSTATEF0000that re-raises with an actionable error pointing operators at the wxyc-postgres runbook when the rules file is missing.Where
docker-compose.yml—image: postgres:16-alpine→image: ghcr.io/wxyc/wxyc-postgres:pg16.github/workflows/ci.yml— drop theInstall wxyc_unaccent rules into the PG service containerstep; update PG serviceimage:toghcr.io/wxyc/wxyc-postgres:pg16migrations/0003_wxyc_identity_match_functions.sql— wrapCREATE TEXT SEARCH DICTIONARYin a plpgsql DO block that catchesSQLSTATE 'F0000'and re-raises with an actionable error including the runbook URLtests/wxyc_identity_match_parity_test.rs— add a negative-path test that runs the migration against a stockpostgres:16-alpine(no rules file), asserts the exception message containswxyc_unaccent.rulesand the runbook URLCLAUDE.md— note the wxyc-postgres image dependency in the migration/CI sectionPlpgsql precheck shape
Other SQLSTATEs propagate unchanged.
Constraints
0003_wxyc_identity_match_functions.sqlin place. The migration is idempotent and re-applying after the precheck is added against an already-stamped DB is a no-op.Acceptance criteria
docker-compose.ymlusesghcr.io/wxyc/wxyc-postgres:pg16F0000→ actionable error with runbook URLpostgres:16-alpine+sqlx migrate run→ expected messageghcr.io/wxyc/wxyc-postgres:pg16(manual, tracked in the wxyc-etl runbook checklist)workflow_dispatchofrebuild-cache.ymlagainst post-swap Railway PG succeeds end-to-endRelated