Skip to content

[CI] No migration-from-scratch job - the 32 backend migrations are never applied against a fresh Postgres in CI, so collision/ordering bugs only surface on the staging server #1252

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

ci.yml backend job has no services: Postgres and never runs npm run migrate:up; it sets DATABASE_URL but no DB is provisioned. The first place migrate:up runs end-to-end is deploy-staging.yml line 182 (on the live server). With known duplicate timestamp prefixes (e.g. 1777000000007, 1778000000008, 1786000000016, 1788000000018 each appear twice) and the ensure-core-tables vs loan_events collision, a broken from-scratch apply ships to staging undetected.

Acceptance criteria

  • A CI job spins up a Postgres service and runs npm run migrate:up from an empty schema, failing on any error
  • It also exercises a migrate:down (or up/down/up) cycle to catch irreversible/ordering issues
  • Job runs on PRs that touch backend/migrations/

Files to touch

  • .github/workflows/ci.yml
  • backend/migrations
  • backend/package.json

Out of scope

  • Fixing the individual migration ordering bugs (already filed)
  • Seeding production data

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdevopsIssues related to CI/CD and infrastructuregithub_actionsPull requests that update GitHub Actions codetestingAdding or fixing tests

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions