feat(enterprise-site): add WordPress support and scheduled auto-publish to sites
Add WordPress as an enterprise-site CMS type alongside pbootcms, and let schedule tasks auto-publish generated articles to enterprise sites. - WordPress connection/publisher service and tests; register wordpress media platform and relax cms_type CHECK constraint - New publish_enterprise_site_targets JSONB column on schedule_tasks with array type constraint; thread targets through scheduler dispatch, prompt/KOL generation, and worker - Admin UI: enterprise-site targets in generate/schedule/publish flows, KOL package form, MediaView, and i18n strings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
ALTER TABLE enterprise_site_connections
|
||||
DROP CONSTRAINT IF EXISTS ck_enterprise_site_connections_cms_type;
|
||||
|
||||
ALTER TABLE enterprise_site_connections
|
||||
ADD CONSTRAINT ck_enterprise_site_connections_cms_type
|
||||
CHECK (cms_type IN ('pbootcms', 'wordpress', 'dedecms', 'phpcms'));
|
||||
|
||||
DELETE FROM media_platforms
|
||||
WHERE platform_id = 'wordpress';
|
||||
@@ -0,0 +1,18 @@
|
||||
INSERT INTO media_platforms (platform_id, name, category, short_name, accent_color, login_url, logo_url, status, sort_order)
|
||||
VALUES ('wordpress', 'WordPress', 'enterprise', 'WP', '#21759b', NULL, NULL, 'active', 901)
|
||||
ON CONFLICT (platform_id)
|
||||
DO UPDATE SET
|
||||
name = EXCLUDED.name,
|
||||
category = EXCLUDED.category,
|
||||
short_name = EXCLUDED.short_name,
|
||||
accent_color = EXCLUDED.accent_color,
|
||||
status = EXCLUDED.status,
|
||||
sort_order = EXCLUDED.sort_order,
|
||||
updated_at = NOW();
|
||||
|
||||
ALTER TABLE enterprise_site_connections
|
||||
DROP CONSTRAINT IF EXISTS ck_enterprise_site_connections_cms_type;
|
||||
|
||||
ALTER TABLE enterprise_site_connections
|
||||
ADD CONSTRAINT ck_enterprise_site_connections_cms_type
|
||||
CHECK (cms_type IN ('pbootcms', 'wordpress'));
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE schedule_tasks
|
||||
DROP CONSTRAINT IF EXISTS chk_schedule_tasks_publish_enterprise_site_targets_json;
|
||||
|
||||
ALTER TABLE schedule_tasks
|
||||
DROP COLUMN IF EXISTS publish_enterprise_site_targets;
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE schedule_tasks
|
||||
ADD COLUMN publish_enterprise_site_targets JSONB NOT NULL DEFAULT '[]'::jsonb;
|
||||
|
||||
ALTER TABLE schedule_tasks
|
||||
ADD CONSTRAINT chk_schedule_tasks_publish_enterprise_site_targets_json
|
||||
CHECK (jsonb_typeof(publish_enterprise_site_targets) = 'array');
|
||||
Reference in New Issue
Block a user