Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Ignore the UI Auth sessions when porting from sqlite to postgresql (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Jun 17, 2020
1 parent e07a8ca commit 6418b03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/7711.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `synapse_port_db` script no longer fails when the `ui_auth_sessions` table is non-empty. This bug has existed since v1.13.0rc1.
19 changes: 12 additions & 7 deletions scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ APPEND_ONLY_TABLES = [
]


IGNORED_TABLES = {
"user_directory",
"user_directory_search",
"users_who_share_rooms",
"users_in_pubic_room",
"ui_auth_sessions",
"ui_auth_sessions_credentials",
}


# Error returned by the run function. Used at the top-level part of the script to
# handle errors and return codes.
end_error = None
Expand Down Expand Up @@ -289,13 +299,8 @@ class Porter(object):
)
return

if table in (
"user_directory",
"user_directory_search",
"users_who_share_rooms",
"users_in_pubic_room",
):
# We don't port these tables, as they're a faff and we can regenreate
if table in IGNORED_TABLES:
# We don't port these tables, as they're a faff and we can regenerate
# them anyway.
self.progress.update(table, table_size) # Mark table as done
return
Expand Down

0 comments on commit 6418b03

Please sign in to comment.