diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-06-21 10:39:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-06-21 10:39:59 +0200 |
commit | 6cd8b9f561b912f264ba4f723845935c40a3cb95 (patch) | |
tree | 5983e0af3d2ee621242ca6707a58c89b9914d8f0 /common/schema/embedded/basics/driver.cxx | |
parent | 236cd9bb1dd022e64d690c9b0080d1a15c5f61c7 (diff) |
Add support for running tests in dynamic multi-database mode
Only possible in the development build system at this stage.
Diffstat (limited to 'common/schema/embedded/basics/driver.cxx')
-rw-r--r-- | common/schema/embedded/basics/driver.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 5a14149..a67529c 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -13,7 +13,6 @@ #include <odb/transaction.hxx> #include <odb/schema-catalog.hxx> -#include <common/config.hxx> // DATABASE_XXX #include <common/common.hxx> #include "test.hxx" @@ -36,9 +35,8 @@ main (int argc, char* argv[]) // Temporarily disable foreign key constraints for SQLite. // -#if defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=OFF"); -#endif + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); assert (schema_catalog::exists (*db, "test")); assert (!schema_catalog::exists (*db, "test1")); @@ -48,9 +46,8 @@ main (int argc, char* argv[]) schema_catalog::create_schema (*db, "test"); t.commit (); -#if defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=ON"); -#endif + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); } } catch (const odb::exception& e) |