Browse Source

enabled foreign keys on startup

main
Stefan Pranger 3 years ago
parent
commit
4a66b49bed
  1. 1
      db/create.h

1
db/create.h

@ -7,6 +7,7 @@
namespace db { namespace db {
sql::Database* init(std::string name) { sql::Database* init(std::string name) {
sql::Database* db = new sql::Database(name, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE); sql::Database* db = new sql::Database(name, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
db->exec("PRAGMA foreign_keys = ON;");
DEBUG << "SQLite database file '" << db->getFilename().c_str() << "' opened successfully\n"; DEBUG << "SQLite database file '" << db->getFilename().c_str() << "' opened successfully\n";
Schema* schema = new Schema(db); Schema* schema = new Schema(db);

Loading…
Cancel
Save