Conversation
|
I can't possibly merge this without a migration path, otherwise it'll break everyone's code. Plus it'd be a break in compatibility/behavior. Finally: how do you recover from the migration error in case it occurs? |
It will not break existing installations, as if your db doesn't have checksum column, it will not populate data for it (will double check)
Same, it should not break compatibility. For all old installations that have no
What I come up with is that users of the library can write their own custom migration that will add column checksum to migration table and fill it with proper values if they want to migrate to checksum verification
The story is that this integrity check prevents you modify migration files after they were applied to database. If you need to modify then something in your schema, you should create new migration file, that will do required changes |
Fairly certain gorp will throw an error if it misses columns. |
|
@rubenv oh, yes, you are right. Just my tests had some cache that's why it didn't throw errors. I'll try to play around this to add new column |
|
Please consider to ignore comments, empty lines, and non-important spaces during hash calculation. |
This fixes #254
During migration apply we store checksum (sha256) of the migration file.
If file was changed, then error returned when try to apply migration.
Unfortunately, didn't find the way to add additional column for already existing migration tables, maybe somebody can come up with the sollution