diff --git a/app/build.gradle b/app/build.gradle index 3fc0e28e9..00ff3d84f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { namespace "com.jerboa" minSdk 26 targetSdk 33 - versionCode 21 - versionName "0.0.22" + versionCode 22 + versionName "0.0.23" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/com/jerboa/db/AppDB.kt b/app/src/main/java/com/jerboa/db/AppDB.kt index fe634cc4b..cf4db6577 100644 --- a/app/src/main/java/com/jerboa/db/AppDB.kt +++ b/app/src/main/java/com/jerboa/db/AppDB.kt @@ -15,6 +15,7 @@ import kotlinx.coroutines.launch import java.util.concurrent.Executors const val DEFAULT_FONT_SIZE = 14 +const val UPDATE_APP_CHANGELOG_UNVIEWED = "UPDATE AppSettings SET viewed_changelog = 0" @Entity data class Account( @@ -219,12 +220,17 @@ val MIGRATION_4_5 = object : Migration(4, 5) { val MIGRATION_5_6 = object : Migration(5, 6) { override fun migrate(database: SupportSQLiteDatabase) { // Update changelog viewed - database.execSQL("UPDATE AppSettings SET viewed_changelog = 0") + database.execSQL(UPDATE_APP_CHANGELOG_UNVIEWED) + } +} +val MIGRATION_6_7 = object : Migration(6, 7) { + override fun migrate(database: SupportSQLiteDatabase) { + database.execSQL(UPDATE_APP_CHANGELOG_UNVIEWED) } } @Database( - version = 6, + version = 7, entities = [Account::class, AppSettings::class], exportSchema = true ) @@ -248,7 +254,14 @@ abstract class AppDB : RoomDatabase() { "jerboa" ) .allowMainThreadQueries() - .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, MIGRATION_5_6) + .addMigrations( + MIGRATION_1_2, + MIGRATION_2_3, + MIGRATION_3_4, + MIGRATION_4_5, + MIGRATION_5_6, + MIGRATION_6_7 + ) // Necessary because it can't insert data on creation .addCallback(object : Callback() { override fun onOpen(db: SupportSQLiteDatabase) {