diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-25 07:35:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-25 09:58:53 +0200 |
commit | 40ae3082645ed3790eb1d5d6f04fb2ca36c19187 (patch) | |
tree | 5157fe5db532ec91b0c06ce5f81d4e92444b7fe9 /evolution/alter-column/driver.cxx | |
parent | 502926d96b0b5d79dc639b8388fbf19b11cda277 (diff) |
Add support for schema version table
Diffstat (limited to 'evolution/alter-column/driver.cxx')
-rw-r--r-- | evolution/alter-column/driver.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index 976f539..a51d09a 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -15,10 +15,10 @@ #include <common/common.hxx> -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // SQLite doesn't support altering of columns. // #ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -50,9 +50,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -73,7 +74,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -100,7 +101,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; |