c6b7090536
Add a cover mode to schedule tasks so auto-publish can pick a random cover image instead of a fixed one, scoped to all images or a specific folder. - migration: add cover_mode / cover_random_scope / cover_random_folder_id columns and check constraints on schedule_tasks - backend: validate cover mode/scope/folder on create & update; the dispatch worker resolves a random active image (signed asset URL) at enqueue time - frontend: new CoverSourceSelector component wired into GenerateTaskDrawer and PublishArticleModal, plus coverSource i18n strings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
684 B
SQL
20 lines
684 B
SQL
ALTER TABLE schedule_tasks
|
|
ADD COLUMN cover_mode VARCHAR(20) NOT NULL DEFAULT 'specific',
|
|
ADD COLUMN cover_random_scope VARCHAR(20) NOT NULL DEFAULT 'all',
|
|
ADD COLUMN cover_random_folder_id BIGINT;
|
|
|
|
ALTER TABLE schedule_tasks
|
|
ADD CONSTRAINT chk_schedule_tasks_cover_mode
|
|
CHECK (cover_mode IN ('specific', 'random'));
|
|
|
|
ALTER TABLE schedule_tasks
|
|
ADD CONSTRAINT chk_schedule_tasks_cover_random_scope
|
|
CHECK (cover_random_scope IN ('all', 'folder'));
|
|
|
|
ALTER TABLE schedule_tasks
|
|
ADD CONSTRAINT chk_schedule_tasks_cover_random_folder_id
|
|
CHECK (
|
|
cover_random_folder_id IS NULL
|
|
OR cover_random_folder_id > 0
|
|
);
|