Add migration to rewrite 'last_updated' column
This commit is contained in:
parent
21102b50dc
commit
eb1b310968
3 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
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")
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue