Migration for node hash invalidation#2136
Conversation
|
There are a number of failing tests |
…. Adding migration scripts to precommit yaml exceptions
|
We are going to put this on hold until #2124 has been addressed, because we run the risk that if that really poses a problem, we will have to issue another migration after having merged this first |
| operations = [ | ||
| migrations.RunPython(notify_user, reverse_code=notify_user), | ||
| migrations.RunSQL( | ||
| """ DELETE FROM db_dbextra WHERE key='""" + _HASH_EXTRA_KEY + """';""", |
There was a problem hiding this comment.
I think it is better to hard code the hash key. If at some point we change the hash key this migration will not work. Even though at that point we will have to add another migration, which would render this one obsolete. Still there would be a scenario possible where the change in key is done before the migration and then this migration is executed, thereby missing all the current hashes.
There was a problem hiding this comment.
That's a good point. Thanks
|
|
||
|
|
||
| def notify_user(apps, schema_editor): | ||
| echo_warning("Invalidating all the hashes of all the nodes. Please " "run verdi rehash", bold=True) |
There was a problem hiding this comment.
Obsolete double quotes (twice) in single string
| conn = op.get_bind() | ||
|
|
||
| # Invalidate all the hashes & inform the user | ||
| echo_warning("Invalidating all the hashes of all the nodes. " "Please run verdi rehash", bold=True) |
This is a fix for issue #2131