Skip to content

Commit

Permalink
Merge branch 'release-prep' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shorthouse committed Nov 11, 2023
2 parents 9b7d72a + a13c346 commit e7ddc96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken

# Keep room database and entities
-keep class * extends androidx.room.RoomDatabase
-keep @androidx.room.Entity class *
# Keep user preferences enums
-keep public enum dev.shorthouse.coinwatch.data.datastore.**{
*;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.shorthouse.coinwatch.data.source.local

import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
Expand All @@ -10,9 +11,11 @@ import dev.shorthouse.coinwatch.data.source.local.model.CachedCoin
import dev.shorthouse.coinwatch.data.source.local.model.FavouriteCoin

@Database(
version = 2,
entities = [FavouriteCoin::class, CachedCoin::class],
version = 1,
exportSchema = false
autoMigrations = [
AutoMigration(from = 1, to = 2)
]
)
@TypeConverters(
PriceTypeConverter::class,
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/dev/shorthouse/coinwatch/di/RoomModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ object RoomModule {
context.applicationContext,
CoinDatabase::class.java,
Constants.COIN_DATABASE_NAME
).build()
)
.fallbackToDestructiveMigration()
.build()
}
}

0 comments on commit e7ddc96

Please sign in to comment.