Remove unused fields
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
package gq.kirmanak.mealient.database
|
||||
|
||||
import androidx.room.AutoMigration
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
import androidx.room.*
|
||||
import androidx.room.migration.AutoMigrationSpec
|
||||
import gq.kirmanak.mealient.database.recipe.RecipeDao
|
||||
import gq.kirmanak.mealient.database.recipe.entity.*
|
||||
|
||||
@Database(
|
||||
version = 4,
|
||||
version = 5,
|
||||
entities = [
|
||||
CategoryEntity::class,
|
||||
CategoryRecipeEntity::class,
|
||||
@@ -23,9 +21,18 @@ import gq.kirmanak.mealient.database.recipe.entity.*
|
||||
autoMigrations = [
|
||||
AutoMigration(from = 1, to = 2),
|
||||
AutoMigration(from = 3, to = 4),
|
||||
AutoMigration(from = 4, to = 5, spec = AppDb.From4To5Migration::class),
|
||||
]
|
||||
)
|
||||
@TypeConverters(RoomTypeConverters::class)
|
||||
abstract class AppDb : RoomDatabase() {
|
||||
abstract fun recipeDao(): RecipeDao
|
||||
|
||||
@DeleteColumn(tableName = "recipe_instruction", columnName = "title")
|
||||
@DeleteColumn(tableName = "recipe_ingredient", columnName = "title")
|
||||
@DeleteColumn(tableName = "recipe_ingredient", columnName = "unit")
|
||||
@DeleteColumn(tableName = "recipe_ingredient", columnName = "food")
|
||||
@DeleteColumn(tableName = "recipe_ingredient", columnName = "disable_amount")
|
||||
@DeleteColumn(tableName = "recipe_ingredient", columnName = "quantity")
|
||||
class From4To5Migration : AutoMigrationSpec
|
||||
}
|
||||
@@ -8,10 +8,5 @@ import androidx.room.PrimaryKey
|
||||
data class RecipeIngredientEntity(
|
||||
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "local_id") val localId: Long = 0,
|
||||
@ColumnInfo(name = "recipe_id") val recipeId: String,
|
||||
@ColumnInfo(name = "title") val title: String,
|
||||
@ColumnInfo(name = "note") val note: String,
|
||||
@ColumnInfo(name = "unit") val unit: String,
|
||||
@ColumnInfo(name = "food") val food: String,
|
||||
@ColumnInfo(name = "disable_amount") val disableAmount: Boolean,
|
||||
@ColumnInfo(name = "quantity") val quantity: Double,
|
||||
)
|
||||
@@ -8,6 +8,5 @@ import androidx.room.PrimaryKey
|
||||
data class RecipeInstructionEntity(
|
||||
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "local_id") val localId: Long = 0,
|
||||
@ColumnInfo(name = "recipe_id") val recipeId: String,
|
||||
@ColumnInfo(name = "title") val title: String,
|
||||
@ColumnInfo(name = "text") val text: String,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user