ALTER TABLE survey_modes
    ADD COLUMN IF NOT EXISTS status VARCHAR(20) NOT NULL DEFAULT 'PLANNED';

ALTER TABLE survey_modes
    DROP CONSTRAINT IF EXISTS chk_survey_modes_status;

ALTER TABLE survey_modes
    ADD CONSTRAINT chk_survey_modes_status
        CHECK (status IN ('PLANNED', 'FINISHED', 'CANCELED', 'FAILED'));
