105 lines
2.6 KiB
Plaintext
105 lines
2.6 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = "postgresql://postgres:root@localhost:5432/zemenu?schema=public"
|
|
}
|
|
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified Boolean @default(false)
|
|
image String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
role String @default("user")
|
|
// Relations
|
|
restaurants Restaurant[]
|
|
accounts Account[]
|
|
sessions Session[]
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
providerId String
|
|
provider String?
|
|
accountId String
|
|
password String?
|
|
accessToken String?
|
|
refreshToken String?
|
|
expiresAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
expiresAt DateTime
|
|
token String? @unique
|
|
ipAddress String?
|
|
userAgent String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
|
|
model Verification {
|
|
id String @id @default(cuid())
|
|
identifier String
|
|
token String
|
|
expiresAt DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
|
|
model Restaurant {
|
|
id String @id @default(uuid())
|
|
name String
|
|
slug String @unique // used as /domain.com/slug
|
|
description String?
|
|
logo String? // image URL
|
|
ownerId String
|
|
owner User @relation(fields: [ownerId], references: [id])
|
|
|
|
template String?
|
|
|
|
categories Category[]
|
|
items MenuItem[]
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
model Category {
|
|
id String @id @default(uuid())
|
|
name String
|
|
|
|
restaurantId String
|
|
restaurant Restaurant @relation(fields: [restaurantId], references: [id])
|
|
|
|
items MenuItem[]
|
|
}
|
|
|
|
model MenuItem {
|
|
id String @id @default(uuid())
|
|
name String
|
|
description String?
|
|
price Float
|
|
image String?
|
|
|
|
categoryId String?
|
|
category Category? @relation(fields: [categoryId], references: [id])
|
|
|
|
restaurantId String
|
|
restaurant Restaurant @relation(fields: [restaurantId], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
} |