Implement migration from 1 to 2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package gq.kirmanak.mealient.data
|
||||
|
||||
import androidx.room.AutoMigration
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
@@ -8,9 +9,21 @@ import gq.kirmanak.mealient.data.recipes.db.entity.*
|
||||
import gq.kirmanak.mealient.extensions.RoomTypeConverters
|
||||
|
||||
@Database(
|
||||
version = 1,
|
||||
entities = [CategoryEntity::class, CategoryRecipeEntity::class, TagEntity::class, TagRecipeEntity::class, RecipeSummaryEntity::class, RecipeEntity::class, RecipeIngredientEntity::class, RecipeInstructionEntity::class],
|
||||
exportSchema = false
|
||||
version = 2,
|
||||
entities = [
|
||||
CategoryEntity::class,
|
||||
CategoryRecipeEntity::class,
|
||||
TagEntity::class,
|
||||
TagRecipeEntity::class,
|
||||
RecipeSummaryEntity::class,
|
||||
RecipeEntity::class,
|
||||
RecipeIngredientEntity::class,
|
||||
RecipeInstructionEntity::class
|
||||
],
|
||||
exportSchema = true,
|
||||
autoMigrations = [
|
||||
AutoMigration(from = 1, to = 2)
|
||||
]
|
||||
)
|
||||
@TypeConverters(RoomTypeConverters::class)
|
||||
abstract class AppDb : RoomDatabase() {
|
||||
|
||||
Reference in New Issue
Block a user