Skip to content

Commit 51ddaf8

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(tiktok): constrain webhook routing migration
1 parent b3f7d28 commit 51ddaf8

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/db/migrations/0282_tiktok_routing_key.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ INNER JOIN "credential"
1717
ON "credential"."id" = (("webhook"."provider_config")::jsonb ->> 'credentialId')
1818
AND "credential"."type" = 'oauth'
1919
AND "credential"."provider_id" = 'tiktok'
20+
INNER JOIN "workflow"
21+
ON "workflow"."id" = "webhook"."workflow_id"
22+
AND "workflow"."workspace_id" = "credential"."workspace_id"
2023
INNER JOIN "account"
2124
ON "account"."id" = "credential"."account_id"
2225
AND "account"."provider_id" = 'tiktok'

packages/db/schema.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,6 @@ export const jobExecutionLogs = pgTable(
833833
})
834834
)
835835

836-
/** Extracts the canonical credential ID persisted in webhook provider configuration. */
837-
export function webhookCredentialIdExpression(column: AnyPgColumn): SQL<string> {
838-
return sql<string>`((${column})::jsonb ->> 'credentialId')`
839-
}
840-
841836
export const webhook = pgTable(
842837
'webhook',
843838
{

0 commit comments

Comments
 (0)