From 40ae3082645ed3790eb1d5d6f04fb2ca36c19187 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Apr 2013 07:35:45 +0200 Subject: Add support for schema version table --- evolution/drop-column/driver.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'evolution/drop-column/driver.cxx') diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 2fddf3a..099fe0f 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -15,10 +15,10 @@ #include -#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 dropping 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 (); } @@ -74,7 +75,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 (); } @@ -93,7 +94,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; -- cgit v1.1