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

Commit f3e55347 authored by cketti's avatar cketti
Browse files

Clean up FTS table on update

parent 071f88e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public class LocalStore extends Store implements Serializable {
     */
    private static final int THREAD_FLAG_UPDATE_BATCH_SIZE = 500;

    public static final int DB_VERSION = 55;
    public static final int DB_VERSION = 56;


    public static String getColumnNameForFlag(Flag flag) {
+11 −0
Original line number Diff line number Diff line
package com.fsck.k9.mailstore.migrations;


import android.database.sqlite.SQLiteDatabase;


class MigrationTo56 {
    static void cleanUpFtsTable(SQLiteDatabase db) {
        db.execSQL("DELETE FROM messages_fulltext WHERE docid NOT IN (SELECT id FROM messages WHERE deleted = 0)");
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ public class Migrations {
                MigrationTo54.addPreviewTypeColumn(db);
            case 54:
                MigrationTo55.createFtsSearchTable(db, migrationsHelper);
            case 55:
                MigrationTo56.cleanUpFtsTable(db);
        }
    }
}