mirror of
https://github.com/taogaetz/chefbible.git
synced 2025-12-06 11:47:24 -05:00
84 lines
2.2 KiB
Plaintext
84 lines
2.2 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
// schema.prisma
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
// output = "./src/generated/prisma/client"
|
|
output = "../node_modules/@prisma-app/client" // fix for sveltekit prisma https://github.com/prisma/prisma/discussions/20200#discussioncomment-7441241
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Recipe {
|
|
id String @id @default(cuid())
|
|
name String
|
|
description String?
|
|
instructions String?
|
|
photoUrl String?
|
|
time String @default("Medium") // Quick, Medium, Long
|
|
station String @default("Pans") // Garde Manger, Pans, Grill
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
// Relations
|
|
ingredients RecipeIngredient[]
|
|
menus MenuRecipe[]
|
|
}
|
|
|
|
model Ingredient {
|
|
id String @id @default(cuid())
|
|
name String @unique
|
|
allergens Allergen[] @relation("IngredientAllergens")
|
|
createdAt DateTime @default(now())
|
|
|
|
recipes RecipeIngredient[]
|
|
}
|
|
|
|
model RecipeIngredient {
|
|
id String @id @default(cuid())
|
|
recipeId String
|
|
ingredientId String
|
|
quantity Float?
|
|
unit String?
|
|
prep String?
|
|
|
|
// Relations
|
|
recipe Recipe @relation(fields: [recipeId], references: [id])
|
|
ingredient Ingredient @relation(fields: [ingredientId], references: [id])
|
|
}
|
|
|
|
model Allergen {
|
|
id String @id @default(cuid())
|
|
name String @unique
|
|
description String?
|
|
ingredients Ingredient[] @relation("IngredientAllergens")
|
|
}
|
|
|
|
model Menu {
|
|
id String @id @default(cuid())
|
|
name String
|
|
season String?
|
|
createdAt DateTime @default(now())
|
|
|
|
recipes MenuRecipe[]
|
|
}
|
|
|
|
model MenuRecipe {
|
|
id String @id @default(cuid())
|
|
menuId String
|
|
recipeId String
|
|
position Int?
|
|
|
|
// Relations
|
|
menu Menu @relation(fields: [menuId], references: [id])
|
|
recipe Recipe @relation(fields: [recipeId], references: [id])
|
|
}
|