Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
22a8c914
Commit
22a8c914
authored
9 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Split up run_upgrade
parent
bcfb6538
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/schema/delta/24/fts.py
+11
-5
11 additions, 5 deletions
synapse/storage/schema/delta/24/fts.py
with
11 additions
and
5 deletions
synapse/storage/schema/delta/24/fts.py
+
11
−
5
View file @
22a8c914
...
...
@@ -55,16 +55,24 @@ CREATE INDEX event_search_ev_ridx ON event_search(room_id);
SQLITE_TABLE
=
(
"
CREATE VIRTUAL TABLE event_search USING fts3 ( event_id, room_id, key, value)
"
)
SQLITE_INDEX
=
"
CREATE INDEX event_search_ev_idx ON event_search(event_id)
"
def
run_upgrade
(
cur
,
database_engine
,
*
args
,
**
kwargs
):
if
isinstance
(
database_engine
,
PostgresEngine
):
for
statement
in
get_statements
(
POSTGRES_SQL
.
splitlines
()):
cur
.
execute
(
statement
)
run_postgres_upgrade
(
cur
)
return
if
isinstance
(
database_engine
,
Sqlite3Engine
):
run_sqlite_upgrade
(
cur
)
return
def
run_postgres_upgrade
(
cur
):
for
statement
in
get_statements
(
POSTGRES_SQL
.
splitlines
()):
cur
.
execute
(
statement
)
def
run_sqlite_upgrade
(
cur
):
cur
.
execute
(
SQLITE_TABLE
)
rowid
=
-
1
...
...
@@ -113,5 +121,3 @@ def run_upgrade(cur, database_engine, *args, **kwargs):
"
VALUES (?,?,?,?)
"
,
rows
)
# cur.execute(SQLITE_INDEX)
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