41 create tenant twilio config #62
1 changed files with 17 additions and 8 deletions
|
|
@ -32,18 +32,27 @@ model User {
|
|||
}
|
||||
|
||||
model Tenant {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
slug String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
clerkOrganizationId String @unique
|
||||
id String @id @default(uuid())
|
||||
clerkOrganizationId String @unique
|
||||
users User[]
|
||||
tenantConfig TenantConfig?
|
||||
|
||||
name String
|
||||
slug String @unique
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model TenantConfig {
|
||||
tenantId String @id
|
||||
id String @id @default(uuid())
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
tenantId String @unique
|
||||
|
||||
accountSID String
|
||||
authToken String
|
||||
phoneNumber String
|
||||
|
and use Zod for validation and use Zod for validation
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue
Not a fan of calling this TenantConfig while it contains twillio specific fields, if you have a new integration like sendgrid, will you just add a new column here? It doesn't feel scalable, I think you could either rename this to TwillioTenantConfig, if you don't wanna deal with it now or have a generic way to store integration credentials. Like have two column, integrationName, integrationValues (JSON column)