hestia/prisma/schema.prisma
2025-01-14 22:29:24 -05:00

41 lines
915 B
Text

// 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"
}
generator pothos {
provider = "prisma-pothos-types"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @default(uuid())
clerkId String
tenant Tenant @relation(fields: [tenantId], references: [id])
tenantId String
email String?
name String
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@id([id, tenantId])
@@unique([clerkId, tenantId])
}
model Tenant {
id String @id @default(uuid())
name String
slug String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
clerkOrganizationId String @unique
users User[]
}