ALTER TABLE manual_task_templates
    ADD COLUMN reward_badge_id INT UNSIGNED NULL AFTER description,
    ADD CONSTRAINT fk_manual_task_templates_badge FOREIGN KEY (reward_badge_id) REFERENCES badge_library (id) ON DELETE SET NULL;

CREATE INDEX idx_manual_task_templates_badge ON manual_task_templates (reward_badge_id);
