From 6cd8b9f561b912f264ba4f723845935c40a3cb95 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jun 2013 10:39:59 +0200 Subject: Add support for running tests in dynamic multi-database mode Only possible in the development build system at this stage. --- common/schema/embedded/basics/driver.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'common/schema/embedded/basics/driver.cxx') 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 #include -#include // DATABASE_XXX #include #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) -- cgit v1.1