Fix SQL foreign-key error when removing accounts on MySQL.

This commit is contained in:
Martin Rotter 2020-11-03 20:12:39 +01:00
parent abe289cf69
commit 429b2bf16d
1 changed files with 5 additions and 5 deletions

View File

@ -1130,13 +1130,13 @@ bool DatabaseQueries::deleteAccount(const QSqlDatabase& db, int account_id) {
query.setForwardOnly(true);
QStringList queries;
queries << QSL("DELETE FROM Messages WHERE account_id = :account_id;")
queries << QSL("DELETE FROM MessageFiltersInFeeds WHERE account_id = :account_id;")
<< QSL("DELETE FROM LabelsInMessages WHERE account_id = :account_id;")
<< QSL("DELETE FROM Messages WHERE account_id = :account_id;")
<< QSL("DELETE FROM Feeds WHERE account_id = :account_id;")
<< QSL("DELETE FROM Categories WHERE account_id = :account_id;")
<< QSL("DELETE FROM MessageFiltersInFeeds WHERE account_id = :account_id;")
<< QSL("DELETE FROM Accounts WHERE id = :account_id;")
<< QSL("DELETE FROM LabelsInMessages WHERE account_id = :account_id;")
<< QSL("DELETE FROM Labels WHERE account_id = :account_id;");
<< QSL("DELETE FROM Labels WHERE account_id = :account_id;")
<< QSL("DELETE FROM Accounts WHERE id = :account_id;");
for (const QString& q : queries) {
query.prepare(q);