-
Notifications
You must be signed in to change notification settings - Fork 199
add migration to fix notifications from pre-1.0.0 upgrade #135
add migration to fix notifications from pre-1.0.0 upgrade #135
Conversation
@@ -48,3 +82,26 @@ def migrate(table_service: TableService, migration_names: List[str]) -> None: | |||
print("applying migration '%s'" % name) | |||
migrations[name](table_service) | |||
print("migration '%s' applied" % name) | |||
|
|||
|
|||
def main(): |
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.
It'd be nice to have some user-facing INFO-level logging so it is clear what's going on.
|
||
count = 0 | ||
for entry in notifications: | ||
try: |
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.
Could you add a comment about why this a non-exceptional UUID parse means we don't have to do anything?
@@ -38,8 +42,38 @@ def migrate_task_os(table_service: TableService) -> None: | |||
print("migrated %s rows" % count) | |||
|
|||
|
|||
def migrate_notification_keys(table_service: TableService) -> None: |
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.
We should maybe have much more explicit names and/or comments, including version info, for migration functions.
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.
Something to think about for the future.
Summary of the Pull Request
In pre-1.0.0, notifications mapped notification_id to RowKey and Container to PartitionKey. In the 1.0.0 release, these got swapped causing pre-1.0.0 upgraded systems to fail.
PR Checklist
Info on Pull Request
A migration for pre-1.0.0 keys in the notifications table
Validation Steps Performed
How does someone test & validate?