Skip to content

hotfix(migrations): revert 0001 + 0003 comment edits to restore sqlx hash - #126

Closed
TaprootFreak wants to merge 1 commit into
developfrom
fix/migration-checksum-revert
Closed

hotfix(migrations): revert 0001 + 0003 comment edits to restore sqlx hash#126
TaprootFreak wants to merge 1 commit into
developfrom
fix/migration-checksum-revert

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

DEV container crash-loop since PR #117 merge: `Migrate(VersionMismatch(1))` because comment edits to versioned migrations (from PR #121 and PR #122) changed the file SHA that sqlx::migrate! computes against `_sqlx_migrations.checksum` on the DEV DB.

This is the same failure mode as #95 — repeating because PR #121's `ce4307c` and the merge-resolution in PR #122 re-applied the cosmetic edits that #95 had undone.

Fix

Restore byte-identical pre-rename content for:

  • `node/migrations/0001_initial.sql` (from `13155c1`, the prior hotfix)
  • `node/migrations/0003_pending_inscriptions.sql` (from `b26a2d1`, last clean state)

0002, 0004, 0005 were never touched. 0006–0008 are not yet applied on DEV (`_sqlx_migrations` only has rows 1–5), so their current `node` wording will become the locked-in hash when they first apply — no action needed.

Test plan

  • `cargo check --workspace --all-features --tests` clean
  • After merge: `zkcoins-node` container exits the restart loop on DEV
  • After merge: `/api/info` on https://dev-api.zkcoins.app returns 200

Follow-up

`feedback_sqlx_migration_hash.md` rule: never edit versioned migration content. Future renames or comment fixes go into a new migration file (`0099_fix_xy.sql`).

…hash

The DEV container has been crash-looping with Migrate(VersionMismatch(1))
since the develop merge (PR #117) brought in the comment edits from PR
#122 (and earlier, PR #121's ce4307c). sqlx::migrate! hashes the FULL
file content (including comments and whitespace) and panics on drift
against _sqlx_migrations.checksum.

Restore the byte-identical pre-rename content from 13155c1 (the prior
hotfix for the same root cause on 0001) and b26a2d1 (for 0003). Per
feedback_sqlx_migration_hash.md: future comment fixes must land in a
follow-up migration, never in the versioned files themselves.

0006-0008 are not yet applied on DEV (DB only has 0001-0005), so their
comment state is whatever ships first — the current "node" wording is
fine going forward.
@TaprootFreak

Copy link
Copy Markdown
Contributor Author

Superseded by #125 (merged 2026-05-27T08:06:00Z, merge commit 5d1bf35). Identical blob diff (d20ef81→51be700 on 0001, 16c4680→216e8c5 on 0003) — parallel hotfix while this branch was prepared. dfxdev container already healthy with the revert applied.

@TaprootFreak
TaprootFreak deleted the fix/migration-checksum-revert branch May 27, 2026 09:31
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