-
-
Notifications
You must be signed in to change notification settings - Fork 8
use file name instead of checksum to check whether a migration was run #81
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
use file name instead of checksum to check whether a migration was run #81
Conversation
to check whether a migration was run
it makes sense, no objection on my side |
The test failed because in the test suite, there are cases where two migrations have the same file name, but are in a different folders. With the old logic, both run, because they had different checksums anyways. Is there a proper use case for two identically named files in different dirs representing different migrations ? Is it used somewhere ? So, with this PR, the migrations are identified using |
I believe this is fine. |
From a strictly-QGEP perspective, yes, but I'm not really aware of usage outside of QGEP. |
I'd ask @elemoine here (hi Eric!) |
Thanks for notifying me @haubourg! No strong opinion here. One thing though: this docstring in the code suggests to use a date in the form |
@olivierdalang status on this? This was a good or a bad idea considering your experiences? |
I think the change is good for the reason described in the initial ticket. From a QGEP perspective, we can merge, because the case of two different migrations with the same name does not happen in QGEP. Maybe if we do that, we should completely remove the ability to specify multiple delta directories (for which I don't know the use case anyway), so that name clashes in migrations are not possible anymore. (however I can't tell if it's worth putting effort in this currently) |
AND success = 'TRUE' | ||
""".format( | ||
self.upgrades_table, delta.get_version(), delta.get_checksum()) | ||
self.upgrades_table, delta.get_version(), delta.get_name(), delta.get_type()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the other PR gets through, let's do formatted strings here too :)
Still slightly scared, but we got to merge it at some point... As far as I understood, the only know case of multi delta dirs is for sigip, where there's just a custom pre and post-all. So merging and let's hope for the best :-) |
As per #79
This is a draft, not sure of the approach... would probably be worth keeping checksum verification to display warnings.