[Digikam-devel] [PATCH 5/5] Temporary workaround to break MySQL references loop with the Albums icon entry.

Richard Mortimer richm at oldelvet.org.uk
Tue Nov 24 09:42:41 GMT 2015


This will not work with SQLITE and needs moving into a dbconfig.xml clause.
---
 libs/database/coredb/coredbcopymanager.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libs/database/coredb/coredbcopymanager.cpp b/libs/database/coredb/coredbcopymanager.cpp
index 38c32a8..b312750 100644
--- a/libs/database/coredb/coredbcopymanager.cpp
+++ b/libs/database/coredb/coredbcopymanager.cpp
@@ -109,6 +109,9 @@ void CoreDbCopyManager::copyDatabases(const DbEngineParameters& fromDBParameters
 
     QMap<QString, QVariant> bindingMap;
 
+    // Drop foreign key on Albums.icon to allow proper delete
+    toDBbackend.execDirectSql(QString::fromUtf8("ALTER TABLE Albums DROP FOREIGN KEY Albums_Images;"));
+
     // Delete all tables
     for (int i=(tablesSize - 1); m_isStopProcessing || i >= 0; --i)
     {
-- 
2.5.0




More information about the Digikam-devel mailing list