Loading app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ import timber.log.Timber; class StoreSchemaDefinition implements SchemaDefinition { static final int DB_VERSION = 77; static final int DB_VERSION = 78; private final MigrationsHelper migrationsHelper; Loading app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo77.ktdeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line package com.fsck.k9.storage.migrations import android.content.ContentValues import android.database.sqlite.SQLiteDatabase /** * Make sure local Outbox folder has correct 'server_id' value */ internal class MigrationTo77(private val db: SQLiteDatabase) { fun cleanUpOutboxServerId() { val values = ContentValues().apply { put("server_id", "K9MAIL_INTERNAL_OUTBOX") } db.update("folders", values, "name = 'Outbox' AND local_only = 1", null) } } app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo78.kt 0 → 100644 +12 −0 Original line number Diff line number Diff line package com.fsck.k9.storage.migrations import android.database.sqlite.SQLiteDatabase /** * Set 'server_id' value to NULL for local folders */ internal class MigrationTo78(private val db: SQLiteDatabase) { fun removeServerIdFromLocalFolders() { db.execSQL("UPDATE folders SET server_id = NULL WHERE local_only = 1") } } app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt +2 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ object Migrations { if (oldVersion < 74) MigrationTo74(db, migrationsHelper.account).removeDeletedMessages() if (oldVersion < 75) MigrationTo75(db, migrationsHelper).updateAccountWithSpecialFolderIds() if (oldVersion < 76) MigrationTo76(db, migrationsHelper).cleanUpSpecialLocalFolders() if (oldVersion < 77) MigrationTo77(db).cleanUpOutboxServerId() // 77: No longer necessary if (oldVersion < 78) MigrationTo78(db).removeServerIdFromLocalFolders() } } Loading
app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ import timber.log.Timber; class StoreSchemaDefinition implements SchemaDefinition { static final int DB_VERSION = 77; static final int DB_VERSION = 78; private final MigrationsHelper migrationsHelper; Loading
app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo77.ktdeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line package com.fsck.k9.storage.migrations import android.content.ContentValues import android.database.sqlite.SQLiteDatabase /** * Make sure local Outbox folder has correct 'server_id' value */ internal class MigrationTo77(private val db: SQLiteDatabase) { fun cleanUpOutboxServerId() { val values = ContentValues().apply { put("server_id", "K9MAIL_INTERNAL_OUTBOX") } db.update("folders", values, "name = 'Outbox' AND local_only = 1", null) } }
app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo78.kt 0 → 100644 +12 −0 Original line number Diff line number Diff line package com.fsck.k9.storage.migrations import android.database.sqlite.SQLiteDatabase /** * Set 'server_id' value to NULL for local folders */ internal class MigrationTo78(private val db: SQLiteDatabase) { fun removeServerIdFromLocalFolders() { db.execSQL("UPDATE folders SET server_id = NULL WHERE local_only = 1") } }
app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt +2 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ object Migrations { if (oldVersion < 74) MigrationTo74(db, migrationsHelper.account).removeDeletedMessages() if (oldVersion < 75) MigrationTo75(db, migrationsHelper).updateAccountWithSpecialFolderIds() if (oldVersion < 76) MigrationTo76(db, migrationsHelper).cleanUpSpecialLocalFolders() if (oldVersion < 77) MigrationTo77(db).cleanUpOutboxServerId() // 77: No longer necessary if (oldVersion < 78) MigrationTo78(db).removeServerIdFromLocalFolders() } }