diff options
author | Erik Johnston <erik@matrix.org> | 2015-04-14 13:53:20 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-04-14 13:53:20 +0100 |
commit | 58d83399663a080c123d2f112b4f4d84accbc638 (patch) | |
tree | 170dfcb466d14dc29276d809a8cda6a4e7f224bc /synapse/storage/__init__.py | |
parent | Correctly increment the _next_id initially (diff) | |
download | synapse-58d83399663a080c123d2f112b4f4d84accbc638.tar.xz |
Add support for postgres instead of mysql. Change sql accourdingly. blob + varbinary -> bytea. No support for UNSIGNED or CREATE INDEX IF NOT EXISTS.
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r-- | synapse/storage/__init__.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index b46cafd25e..272420194d 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py @@ -236,7 +236,7 @@ def _setup_new_database(cur, database_engine): cur.execute( database_engine.convert_param_style( - "REPLACE INTO schema_version (version, upgraded)" + "INSERT INTO schema_version (version, upgraded)" " VALUES (?,?)" ), (max_current_ver, False,) @@ -432,14 +432,11 @@ def executescript(txn, schema_path): def _get_or_create_schema_state(txn, database_engine): - try: - # Bluntly try creating the schema_version tables. - schema_path = os.path.join( - dir_path, "schema", "schema_version.sql", - ) - executescript(txn, schema_path) - except: - pass + # Bluntly try creating the schema_version tables. + schema_path = os.path.join( + dir_path, "schema", "schema_version.sql", + ) + executescript(txn, schema_path) txn.execute("SELECT version, upgraded FROM schema_version") row = txn.fetchone() |