summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-06 13:09:40 +0000
committerErik Johnston <erik@matrix.org>2019-12-06 16:02:21 +0000
commit75f87450d82e5039d90eabd60b70ddea97a6bdbc (patch)
tree7b75e8bd92714d7051f9525c26ca4d432dd3c63b /synapse/storage
parentPass Database into the data store (diff)
downloadsynapse-75f87450d82e5039d90eabd60b70ddea97a6bdbc.tar.xz
Move start up DB checks to main data store.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/data_stores/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/storage/data_stores/__init__.py b/synapse/storage/data_stores/__init__.py
index 79ecc62735..cecc04f03f 100644
--- a/synapse/storage/data_stores/__init__.py
+++ b/synapse/storage/data_stores/__init__.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 from synapse.storage.database import Database
+from synapse.storage.prepare_database import prepare_database
 
 
 class DataStores(object):
@@ -26,4 +27,10 @@ class DataStores(object):
         # Note we pass in the main store here as workers use a different main
         # store.
         database = Database(hs)
+
+        # Check that db is correctly configured.
+        database.engine.check_database(db_conn.cursor())
+
+        prepare_database(db_conn, database.engine, config=hs.config)
+
         self.main = main_store_class(database, db_conn, hs)