File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11-- Resolve the server-attested TikTok open_id once at deploy time, like Slack's
22-- team_id routing. Rows whose credential/account identity cannot be proven are
33-- deliberately left unchanged so the migration never guesses a tenant key.
4- CREATE TEMP TABLE " _tiktok_webhook_routing_backfill" ON COMMIT DROP AS
4+ -- migration-safe: session-local scratch table created only by this migration; no application code reads it.
5+ DROP TABLE IF EXISTS " _tiktok_webhook_routing_backfill" ;
6+ -- > statement-breakpoint
7+ CREATE TEMP TABLE " _tiktok_webhook_routing_backfill" ON COMMIT PRESERVE ROWS AS
58SELECT
69 " webhook" ." id" AS " webhook_id" ,
710 " webhook" ." workflow_id" ,
5356 RAISE NOTICE ' Migrated % TikTok webhook rows to routing_key' , migrated_count;
5457END $$;
5558-- > statement-breakpoint
59+ -- migration-safe: remove the session-local scratch table after the backfill completes.
60+ DROP TABLE IF EXISTS " _tiktok_webhook_routing_backfill" ;
61+ -- > statement-breakpoint
5662COMMIT ;
5763-- > statement-breakpoint
5864SET lock_timeout = 0 ;
You can’t perform that action at this time.
0 commit comments