6e6e19cccb
Replace the legacy target_platform string on schedule tasks with a workspace-aware auto-publish payload (auto_publish + publish_account_ids JSONB + cover_asset_url + cover_image_asset_id) and migrate the schema, sqlc queries, generated models, domain struct, ScheduleTaskService DTOs, and dispatch worker to round-trip the new fields. PromptRuleGeneration gains a WithPublishJobService hook so executeGeneration can enqueue an auto-publish job once the article is ready, and worker-generate wires the publish-job service in. On the admin-web side, extract PublishArticleModal's account-card builders into a shared publish-account-cards module, rebuild GenerateTaskDrawer's schedule mode around account selection plus a CoverPickerModal, and surface the new "auto publish" column on ScheduleTaskTab. Shared types and i18n strings cover the new fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13 lines
479 B
SQL
13 lines
479 B
SQL
ALTER TABLE schedule_tasks
|
|
ADD COLUMN operator_id BIGINT REFERENCES users(id),
|
|
ADD COLUMN enable_web_search BOOLEAN NOT NULL DEFAULT FALSE,
|
|
ADD COLUMN generate_count INT NOT NULL DEFAULT 1;
|
|
|
|
ALTER TABLE schedule_tasks
|
|
ADD CONSTRAINT chk_schedule_tasks_generate_count
|
|
CHECK (generate_count >= 1 AND generate_count <= 20);
|
|
|
|
CREATE INDEX idx_schedule_task_operator
|
|
ON schedule_tasks(tenant_id, operator_id, created_at DESC)
|
|
WHERE deleted_at IS NULL;
|