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

Commit eb1b3109 authored by cketti's avatar cketti
Browse files

Add migration to rewrite 'last_updated' column

parent 21102b50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import timber.log.Timber;


class StoreSchemaDefinition implements SchemaDefinition {
    static final int DB_VERSION = 79;
    static final int DB_VERSION = 80;

    private final MigrationsHelper migrationsHelper;

+12 −0
Original line number Diff line number Diff line
package com.fsck.k9.storage.migrations

import android.database.sqlite.SQLiteDatabase

/**
 * Rewrite 'last_update' column to NULL when the value is 0
 */
internal class MigrationTo80(private val db: SQLiteDatabase) {
    fun rewriteLastUpdatedColumn() {
        db.execSQL("UPDATE folders SET last_updated = NULL WHERE last_updated = 0")
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -25,5 +25,6 @@ object Migrations {
        // 77: No longer necessary
        if (oldVersion < 78) MigrationTo78(db).removeServerIdFromLocalFolders()
        if (oldVersion < 79) MigrationTo79(db).updateDeleteMessageTrigger()
        if (oldVersion < 80) MigrationTo80(db).rewriteLastUpdatedColumn()
    }
}