mirror of
https://github.com/andrey271192/Domain_web.git
synced 2026-09-20 14:41:58 +00:00
feat: rebrand to Domain Scanner platform
Replace GeoExport static site with Next.js domain intelligence app: real DNS/WHOIS/SSL/HTTP/geo scans, SSE progress, Docker stack, updated install/uninstall scripts, and full documentation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
83
prisma/schema.prisma
Normal file
83
prisma/schema.prisma
Normal file
@@ -0,0 +1,83 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
Reference in New Issue
Block a user