Files
geo/server/migrations/20260501103000_remove_legacy_article_platform_json.up.sql
root 490c6c759d feat(article): expose auto_publish_platforms derived from publish accounts
Replace the freeform `platforms` field on articles/tasks (parsed out of
wizard_state/input_params JSON) with `auto_publish_platforms`, resolved
by joining schedule publish accounts to platform_accounts. The migration
strips the legacy keys from existing rows so the new field is the single
source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:02:21 +08:00

12 lines
527 B
SQL

UPDATE articles
SET wizard_state_json = wizard_state_json - 'platforms' - 'target_platforms' - 'target_platform',
updated_at = NOW()
WHERE wizard_state_json IS NOT NULL
AND wizard_state_json ?| ARRAY['platforms', 'target_platforms', 'target_platform'];
UPDATE generation_tasks
SET input_params_json = input_params_json - 'platforms' - 'target_platforms' - 'target_platform',
updated_at = NOW()
WHERE input_params_json IS NOT NULL
AND input_params_json ?| ARRAY['platforms', 'target_platforms', 'target_platform'];