ALTER TABLE posts
    ADD COLUMN IF NOT EXISTS hero_media_id INT UNSIGNED NULL AFTER body,
    ADD KEY idx_posts_hero_media_id (hero_media_id),
    ADD CONSTRAINT fk_posts_hero_media FOREIGN KEY (hero_media_id) REFERENCES media(id) ON DELETE SET NULL;
