From 54e342c763145174d3109bb055fca08a98f37065 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 28 Sep 2013 14:30:05 +0200 Subject: 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). --- evolution/embedded/driver.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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 ()); -- cgit v1.1