feat: integrate creator hub douyin workflows

This commit is contained in:
2026-09-14 19:22:07 +08:00
parent 025fe62c37
commit 44a28954cf
42 changed files with 2850 additions and 880 deletions
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS creator_listener_state (
account_id text PRIMARY KEY REFERENCES social_account (
id
) ON DELETE CASCADE,
platform text NOT NULL CHECK (platform IN ('douyin', 'xiaohongshu')),
generation text NOT NULL DEFAULT '',
status text NOT NULL CHECK (
status IN ('starting', 'ready', 'gap', 'stopped', 'error')
),
boundary_at timestamptz,
last_delivery_id text NOT NULL DEFAULT '',
reason text NOT NULL DEFAULT '',
updated_at timestamptz NOT NULL DEFAULT now()
);
@@ -0,0 +1,9 @@
ALTER TABLE creator_event
ADD COLUMN IF NOT EXISTS message_type text NOT NULL DEFAULT 'text';
ALTER TABLE creator_event
DROP CONSTRAINT IF EXISTS creator_event_message_type_check;
ALTER TABLE creator_event
ADD CONSTRAINT creator_event_message_type_check
CHECK (message_type IN ('text', 'image', 'voice', 'video', 'sticker', 'non_text'));
@@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS creator_source_sync_lease (
source_type text NOT NULL CHECK (source_type IN ('owned', 'competitor')),
source_id text NOT NULL,
lease_token text NOT NULL,
lease_until timestamptz NOT NULL,
updated_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (source_type, source_id)
);
@@ -0,0 +1,2 @@
ALTER TABLE creator_event
ADD COLUMN IF NOT EXISTS gateway_received_at timestamptz;