summaryrefslogtreecommitdiff
path: root/synapse/storage/data_stores/__init__.py
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2019-12-13 16:59:46 +0100
committerAndrej Shadura <andrewsh@debian.org>2019-12-13 16:59:46 +0100
commitee7f97e3d5b8cd1dbce640434316d03d0abc14ae (patch)
tree69f2f7e286fcbf2cba86014bbab0374643e81818 /synapse/storage/data_stores/__init__.py
parentbd05112be2f458e45a1733501753575106e56a89 (diff)
New upstream version 1.7.0
Diffstat (limited to 'synapse/storage/data_stores/__init__.py')
-rw-r--r--synapse/storage/data_stores/__init__.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/synapse/storage/data_stores/__init__.py b/synapse/storage/data_stores/__init__.py
index cb184a98..cafedd5c 100644
--- a/synapse/storage/data_stores/__init__.py
+++ b/synapse/storage/data_stores/__init__.py
@@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from synapse.storage.database import Database
+from synapse.storage.prepare_database import prepare_database
+
class DataStores(object):
"""The various data stores.
@@ -20,7 +23,14 @@ class DataStores(object):
These are low level interfaces to physical databases.
"""
- def __init__(self, main_store, db_conn, hs):
- # Note we pass in the main store here as workers use a different main
+ def __init__(self, main_store_class, db_conn, hs):
+ # Note we pass in the main store class here as workers use a different main
# store.
- self.main = 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)