
START TRANSACTION;

ALTER TABLE EXECUTION_COURSE ADD COLUMN ENTRY_PHASE_VALUE VARCHAR(255) DEFAULT NULL;
UPDATE EXECUTION_COURSE SET ENTRY_PHASE_VALUE = "FIRST_PHASE" WHERE ENTRY_PHASE = 1;
UPDATE EXECUTION_COURSE SET ENTRY_PHASE_VALUE = "SECOND_PHASE" WHERE ENTRY_PHASE = 2;
ALTER TABLE EXECUTION_COURSE DROP COLUMN ENTRY_PHASE, CHANGE COLUMN ENTRY_PHASE_VALUE ENTRY_PHASE VARCHAR(255) NOT NULL;


ALTER TABLE CANDIDACY ADD COLUMN ENTRY_PHASE_VALUE VARCHAR(255) DEFAULT NULL;
UPDATE CANDIDACY SET ENTRY_PHASE_VALUE = "FIRST_PHASE" WHERE ENTRY_PHASE = 1;
UPDATE CANDIDACY SET ENTRY_PHASE_VALUE = "SECOND_PHASE" WHERE ENTRY_PHASE = 2;
ALTER TABLE CANDIDACY DROP COLUMN ENTRY_PHASE, CHANGE COLUMN ENTRY_PHASE_VALUE ENTRY_PHASE VARCHAR(255) DEFAULT NULL;


ALTER TABLE REGISTRATION ADD COLUMN ENTRY_PHASE_VALUE VARCHAR(255) DEFAULT NULL;
UPDATE REGISTRATION SET ENTRY_PHASE_VALUE = "FIRST_PHASE" WHERE ENTRY_PHASE = 1;
UPDATE REGISTRATION SET ENTRY_PHASE_VALUE = "SECOND_PHASE" WHERE ENTRY_PHASE = 2;
ALTER TABLE REGISTRATION DROP COLUMN ENTRY_PHASE, CHANGE COLUMN ENTRY_PHASE_VALUE ENTRY_PHASE VARCHAR(255) DEFAULT NULL;


ALTER TABLE MEASUREMENT_TEST ADD COLUMN ENTRY_PHASE_VALUE VARCHAR(255) DEFAULT NULL;
UPDATE MEASUREMENT_TEST SET ENTRY_PHASE_VALUE = "FIRST_PHASE" WHERE ENTRY_PHASE = 1;
UPDATE MEASUREMENT_TEST SET ENTRY_PHASE_VALUE = "SECOND_PHASE" WHERE ENTRY_PHASE = 2;
ALTER TABLE MEASUREMENT_TEST DROP COLUMN ENTRY_PHASE, CHANGE COLUMN ENTRY_PHASE_VALUE ENTRY_PHASE VARCHAR(255) NOT NULL;


COMMIT;
