diff --git a/catalogue/SqliteConn.cpp b/catalogue/SqliteConn.cpp index e0140f1f9ad4d955d4f95c5f53dd769906d6106c..13076cad198eb7a901dff43ab254b542c1312a8b 100644 --- a/catalogue/SqliteConn.cpp +++ b/catalogue/SqliteConn.cpp @@ -85,7 +85,7 @@ DbStmt *SqliteConn::createStmt(const std::string &sql) { //------------------------------------------------------------------------------ void SqliteConn::createCatalogueDatabaseSchema() { try { - enableForeignKeys(); + execMultiLineNonQuery("PRAGMA foreign_keys = ON;"); const RdbmsCatalogueSchema schema; execMultiLineNonQuery(schema.sql); } catch(exception::Exception &ex) { @@ -93,17 +93,6 @@ void SqliteConn::createCatalogueDatabaseSchema() { } } -//------------------------------------------------------------------------------ -// enableForeignKeys -//------------------------------------------------------------------------------ -void SqliteConn::enableForeignKeys() { - try { - execMultiLineNonQuery("PRAGMA foreign_keys = ON;"); - } catch(exception::Exception &ex) { - throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str()); - } -} - //------------------------------------------------------------------------------ // executeMultiLineNonQuery //------------------------------------------------------------------------------ diff --git a/catalogue/SqliteConn.hpp b/catalogue/SqliteConn.hpp index daad70ef8027361678085f682dcb909b110975d7..90387043f6ff2fa3794aae0d517057622deffae0 100644 --- a/catalogue/SqliteConn.hpp +++ b/catalogue/SqliteConn.hpp @@ -69,19 +69,6 @@ public: */ void createCatalogueDatabaseSchema(); - /** - * This is an SqliteConn specific method that enables foreign key constraints. - */ - void enableForeignKeys(); - - /** - * This is an SqliteConn specific method that executes the specified - * multi-line non-query SQL statement. - * - * @param sql The SQL statement. - */ - void execMultiLineNonQuery(const std::string &sql); - /** * This ia an SqliteConn specific method that prints the database schema to * the specified output stream. @@ -105,6 +92,14 @@ private: */ sqlite3 *m_conn; + /** + * This is an SqliteConn specific method that executes the specified + * multi-line non-query SQL statement. + * + * @param sql The SQL statement. + */ + void execMultiLineNonQuery(const std::string &sql); + }; // class SqliteConn } // namespace catalogue