Fix SQL foreign-key error when removing accounts on MySQL.
This commit is contained in:
parent
abe289cf69
commit
429b2bf16d
@ -1130,13 +1130,13 @@ bool DatabaseQueries::deleteAccount(const QSqlDatabase& db, int account_id) {
|
|||||||
query.setForwardOnly(true);
|
query.setForwardOnly(true);
|
||||||
QStringList queries;
|
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 Feeds WHERE account_id = :account_id;")
|
||||||
<< QSL("DELETE FROM Categories 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 Labels WHERE account_id = :account_id;")
|
||||||
<< QSL("DELETE FROM Accounts WHERE 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;");
|
|
||||||
|
|
||||||
for (const QString& q : queries) {
|
for (const QString& q : queries) {
|
||||||
query.prepare(q);
|
query.prepare(q);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user