Skip to content
Snippets Groups Projects
Commit 7c7786d4 authored by Erik Johnston's avatar Erik Johnston
Browse files

Allow upgrading from old port_from_sqlite3 format

parent b0a14bf5
No related branches found
No related tags found
No related merge requests found
...@@ -458,6 +458,27 @@ class Porter(object): ...@@ -458,6 +458,27 @@ class Porter(object):
")" ")"
) )
# The old port script created a table with just a "rowid" column.
# We want people to be able to rerun this script from an old port
# so that they can pick up any missing events that were not
# ported across.
def alter_table(txn):
txn.execute(
"ALTER TABLE IF EXISTS port_from_sqlite3"
" RENAME rowid TO forward_rowid"
)
txn.execute(
"ALTER TABLE IF EXISTS port_from_sqlite3"
" ADD backward_rowid bigint NOT NULL DEFAULT 0"
)
try:
yield self.postgres_store.runInteraction(
"alter_table", alter_table
)
except Exception as e:
logger.info("Failed to create port table: %s", e)
try: try:
yield self.postgres_store.runInteraction( yield self.postgres_store.runInteraction(
"create_port_table", create_port_table "create_port_table", create_port_table
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment