ALTER TABLE social.feedback_preset
    DROP COLUMN status;

DROP TYPE social.feedback_ui_filter_status;

CREATE TYPE social.feedback_ui_filter_status AS ENUM (
    'opened',
    'need-info',
    'resolved'
);

ALTER TABLE social.feedback_preset
    ADD COLUMN status social.feedback_ui_filter_status;

UPDATE social.feedback_preset
    SET status = CASE WHEN resolved THEN 'resolved'::social.feedback_ui_filter_status
                      ELSE 'opened'::social.feedback_ui_filter_status
                 END
    WHERE resolved IS NOT NULL;

