70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "../generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
password String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
ApiKey ApiKey[]
|
|
}
|
|
|
|
model ApiKey {
|
|
id String @id @default(cuid())
|
|
User User? @relation(fields: [userId], references: [id])
|
|
userId String
|
|
name String
|
|
key String @unique @db.Text
|
|
description String?
|
|
expiredAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model WebHook {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
description String?
|
|
url String
|
|
payload String? @default("{}")
|
|
method String @default("POST")
|
|
headers String? @default("{}")
|
|
apiToken String?
|
|
retries Int? @default(3)
|
|
enabled Boolean @default(true)
|
|
replay Boolean @default(false)
|
|
replayKey String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model WaHook {
|
|
id String @id @default(cuid())
|
|
data Json? @db.Json
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model ChatFlows {
|
|
id String @id @default(cuid())
|
|
flows Json?
|
|
defaultFlow String?
|
|
defaultData Json?
|
|
active Boolean @default(true)
|
|
flowUrl String? @unique
|
|
flowToken String?
|
|
waPhoneNumberId String?
|
|
waToken String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|