aboutsummaryrefslogtreecommitdiff
path: root/common/schema/embedded/basics/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/schema/embedded/basics/driver.cxx')
-rw-r--r--common/schema/embedded/basics/driver.cxx11
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)