Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a strict option to ensure migration step content was not changed #1138

Open
Shinigami92 opened this issue Apr 30, 2024 · 0 comments
Open
Labels
c: feature Request for new feature p: 1-normal Nothing urgent
Milestone

Comments

@Shinigami92
Copy link
Collaborator

Description

Add a strict option to ensure that the produced SQL content of a migration step was not changed along the migration history, so neither project contributors or node-pg-migrate itself does not produce suddenly conflicting intermediate migration steps.

e.g. when there is a major node-pg-migrate update, it could happen that produced SQL changed.
Maybe it is just a renaming of a default type like decimal <-> numeric or a project contributor accidentally touched a migration file that was already rolled out to a prod DB.

Suggested solution

The strict option adds the normalized SQL content of a migration step as e.g. md5 hash into the migration table in a new column.
If the strict mode is enabled, the content is always checked before running new migrations to ensure that the content did not changed.

Additionally there should be a regenerate hash functionality so it is possible to force-override wanted changes.

Alternative

The strict naming is still up for rename.

Additional context

No response

@Shinigami92 Shinigami92 added the c: feature Request for new feature label Apr 30, 2024
@Shinigami92 Shinigami92 added this to the v8.0 milestone Apr 30, 2024
@Shinigami92 Shinigami92 added the p: 1-normal Nothing urgent label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature p: 1-normal Nothing urgent
Projects
None yet
Development

No branches or pull requests

1 participant