feat: Zapier For Teams (#9851)

Co-authored-by: alannnc <[email protected]>
Co-authored-by: zomars <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-14 16:06:57 -07:00
1 parent dcd7e80e6a
commit e98bebb9b2
18 files changed
+247 -62

No files matched your search

@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "ApiKey" ADD COLUMN "teamId" INTEGER;
-- AddForeignKey
ALTER TABLE "ApiKey" ADD CONSTRAINT "ApiKey_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+3
View File
@@ -276,6 +276,7 @@ model Team {
timeZone String @default("Europe/London")
weekStart String @default("Sunday")
routingForms App_RoutingForms_Form[]
apiKeys ApiKey[]
credentials Credential[]
@@unique([slug, parentId])
@@ -564,12 +565,14 @@ model Impersonations {
model ApiKey {
id String @id @unique @default(cuid())
userId Int
teamId Int?
note String?
createdAt DateTime @default(now())
expiresAt DateTime?
lastUsedAt DateTime?
hashedKey String @unique()
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
appId String?