Skip to content
Discussion options

You must be logged in to vote

It's a reasonable thing to do: the stored checksum is just the SHA-384 of the migration file's text, and sqlx only compares it with the _sqlx_migrations row for that version, so after editing comments you can overwrite that row and nothing else will notice. The easiest way to get the exact value is sqlx migrate info, which prints local migration has checksum <hex> for every migration you edited, and then on Postgres:

UPDATE _sqlx_migrations SET checksum = decode('<hex>', 'hex') WHERE version = <version>;

Do it in the same step that ships the edited files, and for every database including local dev ones, because a build with the old file contents will now hit the mismatch the other way round.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@coracoracora
Comment options

Answer selected by coracoracora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants