Fix opening recipes on v0.5.6

This commit is contained in:
Kirill Kamakin
2022-10-29 17:46:28 +02:00
parent 45b1b07372
commit 47addc3b90
17 changed files with 192 additions and 44 deletions

View File

@@ -66,7 +66,7 @@ interface RecipeDao {
@Transaction
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) // The lint is wrong, the columns are actually used
@Query("SELECT * FROM recipe JOIN recipe_summaries ON recipe.remote_id = recipe_summaries.remote_id JOIN recipe_ingredient ON recipe_ingredient.recipe_id = recipe.remote_id JOIN recipe_instruction ON recipe_instruction.recipe_id = recipe.remote_id WHERE recipe.remote_id = :recipeId")
suspend fun queryFullRecipeInfo(recipeId: String): FullRecipeInfo?
suspend fun queryFullRecipeInfo(recipeId: String): FullRecipeEntity?
@Query("DELETE FROM recipe_ingredient WHERE recipe_id = :recipeId")
suspend fun deleteRecipeIngredients(recipeId: String)

View File

@@ -3,7 +3,7 @@ package gq.kirmanak.mealient.database.recipe.entity
import androidx.room.Embedded
import androidx.room.Relation
data class FullRecipeInfo(
data class FullRecipeEntity(
@Embedded val recipeEntity: RecipeEntity,
@Relation(
parentColumn = "remote_id",