Merge pull request #2202 from k9mail/fix_db_migration

Exclude NULL from the list of used parts when cleaning up unused ones.
This commit is contained in:
Philip 2017-02-09 23:18:49 +00:00 committed by GitHub
commit c007271b4e

View file

@ -16,7 +16,7 @@ class MigrationTo58 {
private static void cleanUpMessagePartsTable(SQLiteDatabase db) {
db.execSQL("DELETE FROM message_parts WHERE root NOT IN " +
"(SELECT message_part_id FROM messages WHERE deleted = 0)");
"(SELECT message_part_id FROM messages WHERE deleted = 0 AND message_part_id IS NOT NULL)");
}
static void createDeleteMessageTrigger(SQLiteDatabase db) {