diff options
author | Erik Johnston <erik@matrix.org> | 2015-10-16 11:19:44 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-10-16 11:19:44 +0100 |
commit | 22a8c91448f710c20a6aee66ec2a452528f1d637 (patch) | |
tree | 71e194bc269ffdb21c38891b5ab87510dc8a742c /synapse | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/search (diff) | |
download | synapse-22a8c91448f710c20a6aee66ec2a452528f1d637.tar.xz |
Split up run_upgrade
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/schema/delta/24/fts.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/synapse/storage/schema/delta/24/fts.py b/synapse/storage/schema/delta/24/fts.py index b45a5fd820..0c752d8426 100644 --- a/synapse/storage/schema/delta/24/fts.py +++ b/synapse/storage/schema/delta/24/fts.py @@ -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) |