save recipes
This commit is contained in:
parent
3a887d8dbb
commit
380eb4cd21
18 changed files with 412 additions and 87 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Column, Entity, ManyToOne, Relation} from "typeorm";
|
||||
import { Column, Entity, JoinColumn, ManyToOne, Relation} from "typeorm";
|
||||
import { AbstractEntity } from "./AbstractEntity.js";
|
||||
import { RecipeIngredientGroupEntity } from "./RecipeIngredientGroupEntity.js";
|
||||
|
||||
|
|
@ -19,11 +19,12 @@ export class RecipeIngredientEntity extends AbstractEntity {
|
|||
@Column({nullable: true})
|
||||
unit?: string;
|
||||
|
||||
@Column({ nullable: false })
|
||||
@Column({ name: "sort_order", nullable: false })
|
||||
sortOrder!: number;
|
||||
|
||||
@JoinColumn({name: "recipe_ingredient_group_id"})
|
||||
@ManyToOne(() => RecipeIngredientGroupEntity, (ingredientGroup) => ingredientGroup.ingredients,
|
||||
{onDelete: "CASCADE"}
|
||||
{onDelete: "CASCADE", nullable: false}
|
||||
)
|
||||
ingredientGroup!: Relation<RecipeIngredientGroupEntity>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue