Skip to content

Ability to disable hash checking for some migrations #97

@KivApple

Description

@KivApple

If you use JavaScript migrations it is possible to generate an unique SQL string each time when application starts. In this case postgres-migrations will fail because of hash mismatch. It would be nice to have an ability to disable hash checking for some migrations like it's already possible to disable transactions using a special comment string.

Possible real-world scenarious when generated query might be different on every application startup:

  • Inserting rows with generated by JavaScript UUID values
  • Inserting rows with current date and/or time values obtained by JavaScript
  • Inserting salted passwords into the user table (e. g. create a first user after application installation)

Sometimes it's possible to have a workaround moving the value generation to SQL (e. g. use NOW() SQL expression, use pg_crypto module for UUID generation etc), but it's not always either possible or readable (actually complex data generation is the reason to use JavaScript migrations).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions