Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
7c7786d4
Commit
7c7786d4
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Allow upgrading from old port_from_sqlite3 format
parent
b0a14bf5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/synapse_port_db
+21
-0
21 additions, 0 deletions
scripts/synapse_port_db
with
21 additions
and
0 deletions
scripts/synapse_port_db
+
21
−
0
View file @
7c7786d4
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment