BEGIN;

ALTER TABLE creative_projects
    ADD COLUMN short_drama_type varchar(100),
    ADD COLUMN play_count bigint,
    ADD COLUMN audience_profile text,
    ADD COLUMN producer varchar(200),
    ADD COLUMN cast_members jsonb NOT NULL DEFAULT '[]'::jsonb;

ALTER TABLE creative_projects
    ADD CONSTRAINT creative_projects_play_count_check
        CHECK (play_count IS NULL OR play_count >= 0),
    ADD CONSTRAINT creative_projects_cast_members_check
        CHECK (jsonb_typeof(cast_members) = 'array');

COMMIT;
