0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-04 21:58:54 +01:00

Merge pull request #633 from matrix-org/daniel/ick

Idempotent-ise schema update script
This commit is contained in:
Daniel Wagner-Hall 2016-03-08 17:45:46 +00:00
commit b117f67227

View file

@ -20,7 +20,11 @@ logger = logging.getLogger(__name__)
def run_upgrade(cur, database_engine, config, *args, **kwargs): def run_upgrade(cur, database_engine, config, *args, **kwargs):
# NULL indicates user was not registered by an appservice. # NULL indicates user was not registered by an appservice.
try:
cur.execute("ALTER TABLE users ADD COLUMN appservice_id TEXT") cur.execute("ALTER TABLE users ADD COLUMN appservice_id TEXT")
except:
# Maybe we already added the column? Hope so...
pass
cur.execute("SELECT name FROM users") cur.execute("SELECT name FROM users")
rows = cur.fetchall() rows = cur.fetchall()