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).
If you use JavaScript migrations it is possible to generate an unique SQL string each time when application starts. In this case
postgres-migrationswill 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:
Sometimes it's possible to have a workaround moving the value generation to SQL (e. g. use
NOW()SQL expression, usepg_cryptomodule for UUID generation etc), but it's not always either possible or readable (actually complex data generation is the reason to use JavaScript migrations).