1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 62f89b8d8c..2e97bbab3b 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -526,6 +526,14 @@ def read_schema(schema):
return schema_file.read()
+class PrepareDatabaseException(Exception):
+ pass
+
+
+class UpgradeDatabaseException(PrepareDatabaseException):
+ pass
+
+
def prepare_database(db_conn):
""" Set up all the dbs. Since all the *.sql have IF NOT EXISTS, so we
don't have to worry about overwriting existing content.
@@ -542,6 +550,10 @@ def prepare_database(db_conn):
"Cannot use this database as it is too " +
"new for the server to understand"
)
+ elif user_version < 10:
+ raise UpgradeDatabaseException(
+ "No delta for versions less than 10"
+ )
elif user_version < SCHEMA_VERSION:
logger.info(
"Upgrading database from version %d",
|