63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
// 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 Restaurant {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
main_image String
|
|
images String[]
|
|
description String
|
|
open_time String
|
|
close_time String
|
|
slug String @unique
|
|
price PRICE
|
|
items Item[]
|
|
location_id Int
|
|
location Location @relation(fields: [location_id], references: [id])
|
|
cuisine_id Int
|
|
cuisine Cuisine @relation(fields: [cuisine_id], references: [id])
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
}
|
|
|
|
model Item {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
price String
|
|
description String
|
|
restaurant_id Int
|
|
restaurant Restaurant @relation(fields: [restaurant_id], references: [id])
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
}
|
|
|
|
model Location {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
restaurants Restaurant[]
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
}
|
|
|
|
model Cuisine {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
restaurants Restaurant[]
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
}
|
|
|
|
enum PRICE {
|
|
CHEAP
|
|
REGULAR
|
|
EXPENSIVE
|
|
} |