Skip to content

hotfix(migration): revert SQL comment edit (sqlx hash stable) - #95

Merged
TaprootFreak merged 1 commit into
developfrom
hotfix/sqlx-migration-hash-revert
May 25, 2026
Merged

hotfix(migration): revert SQL comment edit (sqlx hash stable)#95
TaprootFreak merged 1 commit into
developfrom
hotfix/sqlx-migration-hash-revert

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Why

PR #93 (rename: server → node) edited two prose comments in
`node/migrations/0001_initial.sql`. sqlx::migrate! hashes the
entire file, so the change drifted the migration hash. On startup
the server panics:

```
thread 'main' panicked at node/src/main.rs:68:14:
connect and migrate database: Migrate(VersionMismatch(1))
```

(Observed on `dev-api.zkcoins.app` in restart loop after the
cutover to `zkcoin/node:beta`.)

What

Revert the two comment lines. File is byte-identical to its pre-#93
state, hash matches `_sqlx_migrations.checksum` on DEV + PRD,
migration is considered already-applied, server boots.

Test

  • `cargo check -p node` — sqlx compile-time migration list still
    parses (no schema change).
  • After merge: CI builds + pushes `zkcoin/node:beta`, DEV container
    restart loop ends, `dev-api.zkcoins.app/api/info` returns 200.

The rename PR (#93) edited two comment lines in
node/migrations/0001_initial.sql ("zkCoins server state-layer" →
"zkCoins node state-layer" and "server bootstrap" → "node bootstrap").
sqlx::migrate! hashes the entire file content, so the hash drifted —
on startup the server panics with `Migrate(VersionMismatch(1))`
because the `_sqlx_migrations` row on PRD/DEV still carries the
pre-rename hash. Reverting the two comments restores the original
hash and the migration is considered already-applied as intended.

Cosmetic prose updates to migration files are out of bounds; the
historical accuracy ("server" was the name when the schema landed)
is the correct value anyway.
@TaprootFreak TaprootFreak added the ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra) label May 25, 2026
@TaprootFreak
TaprootFreak merged commit 13155c1 into develop May 25, 2026
5 of 9 checks passed
TaprootFreak added a commit that referenced this pull request May 27, 2026
…hash (#125)

After #117 merged to develop the dfxdev container started crash-looping
with `Migrate(VersionMismatch(1))` and the deploy-dev smoke test
returned 502 for ~5 min straight before the workflow failed.

Root cause: commit ce4307c ("docs(migrations): replace remaining
'server' with 'node' in SQL comments") edited the comment lines in
the already-applied migrations `0001_initial.sql` and
`0003_pending_inscriptions.sql`. sqlx hashes the migration file
content (comments included), so a deployed DB whose
`_sqlx_migrations.checksum` reflects the pre-edit text refuses to
boot with the post-edit binary. This is the exact same class of
issue that PR #95 already had to hotfix (`13155c1 hotfix(migration):
revert SQL comment edit to keep sqlx hash stable`) and that
`feedback_sqlx_migration_hash` documents.

Fix: restore both files to their pre-ce4307c byte-for-byte content.
Pure cosmetic revert — the only difference is "node" → "server" in
6 lines of `--` comments. No schema, no logic, no data change. The
container's first boot after this lands will match its existing
`_sqlx_migrations` row and proceed past the migrate step.

If the "node" / "server" vocabulary is eventually wanted in the
migration prose, the right move is a NEW migration whose comments
use the chosen vocabulary — the old ones must stay frozen for the
checksum to match deployed databases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant