server: Switch to steps a single blob of text

This commit is contained in:
traxys 2023-06-25 21:10:44 +02:00
parent 27f9295aa3
commit b01f08ba2f
4 changed files with 14 additions and 61 deletions

View file

@ -7,5 +7,4 @@ pub mod household_members;
pub mod ingredient;
pub mod recipe;
pub mod recipe_ingerdients;
pub mod recipe_steps;
pub mod user;

View file

@ -5,5 +5,4 @@ pub use super::household_members::Entity as HouseholdMembers;
pub use super::ingredient::Entity as Ingredient;
pub use super::recipe::Entity as Recipe;
pub use super::recipe_ingerdients::Entity as RecipeIngerdients;
pub use super::recipe_steps::Entity as RecipeSteps;
pub use super::user::Entity as User;

View file

@ -11,6 +11,8 @@ pub struct Model {
pub name: String,
pub ranking: i32,
pub household: Uuid,
#[sea_orm(column_type = "Text")]
pub steps: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
@ -23,8 +25,6 @@ pub enum Relation {
on_delete = "Restrict"
)]
Household,
#[sea_orm(has_many = "super::recipe_steps::Entity")]
RecipeSteps,
}
impl Related<super::household::Entity> for Entity {
@ -33,12 +33,6 @@ impl Related<super::household::Entity> for Entity {
}
}
impl Related<super::recipe_steps::Entity> for Entity {
fn to() -> RelationDef {
Relation::RecipeSteps.def()
}
}
impl Related<super::ingredient::Entity> for Entity {
fn to() -> RelationDef {
super::recipe_ingerdients::Relation::Ingredient.def()