Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c007271b authored by Philip's avatar Philip Committed by GitHub
Browse files

Merge pull request #2202 from k9mail/fix_db_migration

Exclude NULL from the list of used parts when cleaning up unused ones.
parents 168f9a8c 47a5b528
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@ class MigrationTo58 {


    private static void cleanUpMessagePartsTable(SQLiteDatabase db) {
    private static void cleanUpMessagePartsTable(SQLiteDatabase db) {
        db.execSQL("DELETE FROM message_parts WHERE root NOT IN " +
        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) {
    static void createDeleteMessageTrigger(SQLiteDatabase db) {