aboutsummaryrefslogtreecommitdiff
path: root/evolution/soft-delete/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'evolution/soft-delete/driver.cxx')
-rw-r--r--evolution/soft-delete/driver.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx
index fa5c810..95b62b5 100644
--- a/evolution/soft-delete/driver.cxx
+++ b/evolution/soft-delete/driver.cxx
@@ -13,8 +13,8 @@
#include <odb/transaction.hxx>
#include <odb/schema-catalog.hxx>
-#include <common/common.hxx>
#include <common/config.hxx> // DATABASE_XXX
+#include <common/common.hxx>
#include "test2.hxx"
#include "test3.hxx"
@@ -46,11 +46,20 @@ main (int argc, char* argv[])
if (embedded)
{
+ // SQLite has broken foreign keys when it comes to DDL.
+ //
+#ifdef DATABASE_SQLITE
+ db->connection ()->execute ("PRAGMA foreign_keys=OFF");
+#endif
transaction t (db->begin ());
schema_catalog::drop_schema (*db);
schema_catalog::create_schema (*db, "", false);
schema_catalog::migrate_schema (*db, 2);
t.commit ();
+
+#ifdef DATABASE_SQLITE
+ db->connection ()->execute ("PRAGMA foreign_keys=ON");
+#endif
}
// Test soft-deleted objects.