Open hyahyaoui opened 4 years ago
Hi. I'm trying to understand the added value of your feature request. So I have a few questions for you:
Thank you for your feedback!
I can see two use case to this feature, one, is the described at the #141 , the other one is to prevent the edition of a previous migration file.
Maybe adding the options to decide what to do when an already applied migration checksum changes, the migrate-mongo have to rerun and update the checksum, ignore it, or halt the process.
So it can cover the two scenarios and is possible to set the 'ignore' option as default for those that already use the migrate-mongo and expect that to function as is today (simply ignoring file changes).
I made comment to this here: https://github.com/seppevs/migrate-mongo/issues/225#issuecomment-673104002
Answers to @seppevs Q's:
Existing migrations, once PR'd and installed in any persisted environment should not be edited again. Unfortunately, at times people don't always do the right things, find an error, make a quick fix to an existing migration, "it works on my machine". If this migration is already released, the change is not applied, the next developer creates a new migration based on the current state of the repo, "it works on my machine", but blows up in Prod.
Other tools we use on SQL DB's, calc the SHA of each migration file and compare it with the SHA stored in a metadata table for the migrations, if there is a mismatch for any of the previously applied migrations, the migration is immediately halted. This effectively prevents any new migration from running, possibly corrupting data because of an inconsistent state.
Hello i'm discovering the project and i figured out that checksum of migration file is not computed. I can update an already executed migration file without any problem. It would be nice if a checksum can be applied for the content of the file and it's name Thank you