32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
model Site {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
tenantId String
|
|
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
|
|
type String // "community", "booking" - references code-defined SITE_TYPES
|
|
siteId String // "downtown" OR "patients.clinica.com" - unique per type
|
|
name String // "Downtown Booking"
|
|
|
|
isActive Boolean @default(true)
|
|
|
|
// Tenant customizations (merged with SITE_TYPES defaults)
|
|
branding String @default("{}")
|
|
copy String @default("{}")
|
|
|
|
// Server selection (for URL preview)
|
|
serverName String // "Local Booking", "Booking Demo"
|
|
serverHost String // "localhost:3001", "booking.example.com"
|
|
serverResolution String // "domain" | "path" | "subdomain"
|
|
|
|
// Metadata
|
|
createdByUserId String?
|
|
createdByUser User? @relation("sitesCreatedByUser", fields: [createdByUserId], references: [id])
|
|
|
|
@@unique([type, siteId]) // siteId unique per site type (NOT per tenant)
|
|
@@index([tenantId])
|
|
@@index([type])
|
|
}
|