diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-28 14:30:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-28 14:30:05 +0200 |
commit | 54e342c763145174d3109bb055fca08a98f37065 (patch) | |
tree | 0485f786bb4c89f380a5c841fe0f0a131114f9b0 | |
parent | fb95c049bcd5c639225759d71e7f85d3435ad018 (diff) |
Rework migration API in schema_catalog
Specifically:
- Rename latest_version() to current_version().
- Change next_version() to return one past current instead of 0 if
passed current.
- migrate() will now do schema creation if current database version
is 0 (no schema).
-rw-r--r-- | evolution/embedded/driver.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 60c8c18..a1ac0e4 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -79,6 +79,14 @@ main (int argc, char* argv[]) using namespace v2; using namespace v3; + // Check version information correctness. + // + assert (schema_catalog::current_version (*db) == 3); + assert (schema_catalog::next_version (*db, 0) == 3); + assert (schema_catalog::next_version (*db, 1) == 2); + assert (schema_catalog::next_version (*db) == 3); + assert (schema_catalog::next_version (*db, 3) == 4); + { assert (db->schema_version () == 2 && !db->schema_migration ()); |