Created
October 20, 2024 01:37
-
-
Save mellumeriktest/0ac8c19fe87a7108ff3a2f1b2a8e4b9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is your Prisma schema file, | |
// learn more about it in the docs: https://pris.ly/d/prisma-schema | |
datasource db { | |
provider = "mysql" | |
url = env("DATABASE_URL") | |
referentialIntegrity = "prisma" | |
} | |
generator client { | |
provider = "prisma-client-js" | |
previewFeatures = ["referentialIntegrity"] | |
} | |
model User { | |
user_id String @id @default(cuid()) | |
name String? | |
email String? @unique | |
emailVerified DateTime? | |
// recipes Recipe[] | |
} | |
model Ingredient { | |
ingredient_id String @id @default(cuid()) | |
name String? | |
description String? | |
ingredient_measurements IngredientMeasurement[] | |
} | |
model Recipe { | |
recipe_id String @id @default(cuid()) | |
name String? | |
description String? | |
ingredient_measurements IngredientMeasurement[] | |
// user User @relation(fields: [user_id], references: [user_id]) | |
// user_id String | |
} | |
model IngredientMeasurement { | |
@@id([ingredient_id, recipe_id]) | |
ingredient_id String | |
ingredient Ingredient @relation(fields: [ingredient_id], references: [ingredient_id]) | |
recipe Recipe @relation(fields: [recipe_id], references: [recipe_id]) | |
recipe_id String | |
unit String | |
quantity Int @default(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment