mirror of
https://github.com/GithubOrgProjectPiza/server.git
synced 2026-09-04 00:26:07 +02:00
Add broken prisma schema
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
role Role @default(USER)
|
||||
orders Order[]
|
||||
}
|
||||
|
||||
model Restaurant {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
description String?
|
||||
pizzas Pizza[]
|
||||
}
|
||||
|
||||
model Pizza {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
description String?
|
||||
restaurant Restaurant @relation(fields: [restaurantId], references: [id])
|
||||
restaurantId Int
|
||||
}
|
||||
|
||||
model Order {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId Int
|
||||
pizza Pizza @relation(fields: [pizzaId], references: [id])
|
||||
pizzaId Int
|
||||
amount Int
|
||||
}
|
||||
|
||||
enum Role {
|
||||
USER
|
||||
ADMIN
|
||||
}
|
||||
Reference in New Issue
Block a user