Skip to content

Commit

Permalink
Upping version.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines committed Dec 30, 2022
1 parent b040c2b commit 92e9e5f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 16 additions & 3 deletions app/src/main/java/com/jerboa/db/AppDB.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
Expand All @@ -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) {
Expand Down

0 comments on commit 92e9e5f

Please sign in to comment.