mirror of
https://github.com/andrey271192/Domain_web.git
synced 2026-09-20 14:41:58 +00:00
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>
85 lines
1.7 KiB
Plaintext
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")
|
|
}
|