41 create tenant twilio config #62
1 changed files with 17 additions and 8 deletions
|
|
@ -33,17 +33,26 @@ model User {
|
||||||
|
|
||||||
model Tenant {
|
model Tenant {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
name String
|
|
||||||
slug String @unique
|
|
||||||
createdAt DateTime @default(now())
|
|
||||||
updatedAt DateTime @updatedAt
|
|
||||||
clerkOrganizationId String @unique
|
clerkOrganizationId String @unique
|
||||||
users User[]
|
users User[]
|
||||||
|
tenantConfig TenantConfig?
|
||||||
|
|
||||||
|
name String
|
||||||
|
slug String @unique
|
||||||
|
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
model TenantConfig {
|
model TenantConfig {
|
||||||
tenantId String @id
|
id String @id @default(uuid())
|
||||||
|
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||||
|
tenantId String @unique
|
||||||
|
|
||||||
accountSID String
|
accountSID String
|
||||||
authToken String
|
authToken String
|
||||||
phoneNumber 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)