aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-28 14:30:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-28 14:30:05 +0200
commit54e342c763145174d3109bb055fca08a98f37065 (patch)
tree0485f786bb4c89f380a5c841fe0f0a131114f9b0
parentfb95c049bcd5c639225759d71e7f85d3435ad018 (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.cxx8
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 ());