Skip to content

chore(migrations): resync the schema-snapshot chain - #616

Merged
Ardnived merged 1 commit into
mainfrom
fix/migration-snapshot-chain
Aug 4, 2026
Merged

Ardnived merged 1 commit into
mainfrom
fix/migration-snapshot-chain

Conversation

@Ardnived

@Ardnived Ardnived commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Heals the migration schema-snapshot chain on main. Follow-up to #601.

When #601 merged, its 20260803_..._registrations_full migration became the highest-timestamp entry — but its .json snapshot was generated before #605/#608's schema landed (region level venue, events contact_email / address_venue_name, translations event_title). Those migrations are timestamped earlier than 0803 but merged later, so 0803.json was left stale (the "out-of-order snapshot trap" documented in .claude/rules/migrations.md).

Left as-is, the next pnpm db:migrations:create would diff against that stale snapshot and re-emit the already-applied DDL (ADD COLUMN contact_email, the center→venue enum recreate, …) — which fails on deploy.

Change

A single no-op migration, 20260804_011222_resync_schema_snapshot:

  • .ts does nothing — every column it would "add" already ships in an earlier migration in the chain.
  • .json is the regenerated, now-cumulative snapshot (full current schema). This is the entire point: it becomes the new highest-timestamp snapshot, so future migrate:create diffs from the true current schema.

Verification

  • pnpm db:migrations:create now reports no schema changes (the cumulative snapshot matches the config) — confirms the chain is healed.
  • pnpm typecheck + pnpm lint pass.
  • No runtime/schema impact: the migration is a no-op; on deploy it records itself and moves on. Nothing to test beyond the snapshot resync.

🤖 Generated with Claude Code

The highest-timestamp snapshot on main
(20260803_221051_registrations_full_flag.json) was stale: it merged in via
PR #601, whose registrations_full migration was generated before #605/#608's
schema landed (region level `venue`, events contact_email / address_venue_name,
translations event_title). Those migrations are timestamped earlier than 0803
but merged later — the out-of-order snapshot trap in .claude/rules/migrations.md.

The next migrate:create would have diffed against that stale snapshot and
re-emitted the already-applied DDL. This lands a no-op migration whose
regenerated .json reflects the full current schema, so the chain is healed:
migrate:create now detects no changes (verified). The .ts does nothing — every
column already ships in an earlier migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@railway-app

railway-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-616 environment in sahajcloud

Service Status Web Updated (UTC)
SahajCloud 🕒 Building (View Logs) Web Aug 4, 2026 at 1:32 am

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-616 August 4, 2026 01:32 Destroyed
@Ardnived
Ardnived merged commit 03b2be1 into main Aug 4, 2026
1 of 2 checks passed
@Ardnived
Ardnived deleted the fix/migration-snapshot-chain branch August 4, 2026 01:33

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-616 — f6baffc6 Deployed Aug 4, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant