Files
ospab.host/ospabhost/backend/prisma/schema.prisma

41 lines
1.0 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 = "mysql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
username String
email String @unique
password String
createdAt DateTime @default(now())
plans Plan[]
operator Int @default(0) // Добавляем новую колонку operator
}
model Plan {
id Int @id @default(autoincrement())
name String @unique
price Float
description String?
isCustom Boolean @default(false)
createdAt DateTime @default(now())
userId Int
owner User @relation(fields: [userId], references: [id])
services Service[]
}
model Service {
id Int @id @default(autoincrement())
name String @unique
price Float
planId Int?
plan Plan? @relation(fields: [planId], references: [id])
}