Files
Domain_web/prisma/schema.prisma
Андрей Бобырев 658b329784 fix(prisma): add debian binary target for VPS deploy
Generate Prisma engines for Linux production hosts; install script
uses lite path (DB in Docker, Next on host).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 23:06:34 +03:00

85 lines
1.7 KiB
Plaintext

generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
enum Role {
USER
ADMIN
}
enum ScanStatus {
PENDING
RUNNING
COMPLETED
FAILED
}
enum MonitorType {
DNS
SSL
UPTIME
}
model User {
id String @id @default(cuid())
email String @unique
name String?
passwordHash String
role Role @default(USER)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
scans Scan[]
monitors Monitor[]
}
model Scan {
id String @id @default(cuid())
domain String
status ScanStatus @default(PENDING)
progress Int @default(0)
result Json?
error String?
userId String?
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
ip String?
userAgent String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([domain])
@@index([createdAt])
@@map("scans")
}
model Monitor {
id String @id @default(cuid())
domain String
type MonitorType
enabled Boolean @default(true)
lastChecked DateTime?
lastResult Json?
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId])
@@map("monitors")
}
model ApiRateLimit {
id String @id @default(cuid())
key String @unique
count Int @default(0)
windowEnd DateTime
updatedAt DateTime @updatedAt
@@map("api_rate_limits")
}