diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-04 08:34:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-04 08:34:17 +0200 |
commit | 02f8e411774a5e77fef6fa4ea8b3604bad8c3d43 (patch) | |
tree | c78858656415b88e683e6ba2a5b45dfb2e72d842 | |
parent | e1a94ec4ab5d4b946dd848666107f68813491ae2 (diff) |
Throw unknown_schema_version from migrate() if database is too new
-rw-r--r-- | odb/schema-catalog.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/odb/schema-catalog.cxx b/odb/schema-catalog.cxx index fb3ab82..1bdc112 100644 --- a/odb/schema-catalog.cxx +++ b/odb/schema-catalog.cxx @@ -267,6 +267,9 @@ namespace odb schema_version i (db.schema_version (name)); + if (i > v) + throw unknown_schema_version (i); // Database too new. + // If there is no schema, then "migrate" by creating it. // if (i == 0) |