ALTER TABLE TEACHER_LEGAL_REGIMEM ADD COLUMN KEY_LEGAL_REGIMEN_TYPE INT(11);

UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='1' WHERE LEGAL_REGIMEN_TYPE='PROVISIONS_ADMINISTRATIVE_CONTRACT';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='2' WHERE LEGAL_REGIMEN_TYPE='PROVISIONS_ADMINISTRATIVE_CONTRACT_SUSPENDED';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='3' WHERE LEGAL_REGIMEN_TYPE='TERM_CONTRACT';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='4' WHERE LEGAL_REGIMEN_TYPE='TEMPORARY_SUBSTITUTION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='5' WHERE LEGAL_REGIMEN_TYPE='DEFINITIVE_NOMINATION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='6' WHERE LEGAL_REGIMEN_TYPE='PROVISORY_NOMINATION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='7' WHERE LEGAL_REGIMEN_TYPE='RETIREMENT';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='8' WHERE LEGAL_REGIMEN_TYPE='DEATH';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='9' WHERE LEGAL_REGIMEN_TYPE='EMERITUS';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='10' WHERE LEGAL_REGIMEN_TYPE='RETIREMENT_IN_PROGRESS';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='11' WHERE LEGAL_REGIMEN_TYPE='CERTAIN_FORWARD_CONTRACT_END';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='12' WHERE LEGAL_REGIMEN_TYPE='CERTAIN_FORWARD_CONTRACT_END_PROPER_PRESCRIPTIONS';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='13' WHERE LEGAL_REGIMEN_TYPE='CERTAIN_FORWARD_CONTRACT_RESCISSION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='14' WHERE LEGAL_REGIMEN_TYPE='CERTAIN_FORWARD_CONTRACT_RESCISSION_PROPER_PRESCRIPTIONS';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='15' WHERE LEGAL_REGIMEN_TYPE='CONTRACT_END';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='16' WHERE LEGAL_REGIMEN_TYPE='DENUNCIATION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='17' WHERE LEGAL_REGIMEN_TYPE='IST_OUT_NOMINATION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='18' WHERE LEGAL_REGIMEN_TYPE='SERVICE_TURN_OFF';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='19' WHERE LEGAL_REGIMEN_TYPE='TEMPORARY_SUBSTITUTION_CONTRACT_END';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='20' WHERE LEGAL_REGIMEN_TYPE='EXONERATION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='21' WHERE LEGAL_REGIMEN_TYPE='RESCISSION';
UPDATE TEACHER_LEGAL_REGIMEM SET KEY_LEGAL_REGIMEN_TYPE='22' WHERE LEGAL_REGIMEN_TYPE='TRANSFERENCE';

ALTER TABLE TEACHER_LEGAL_REGIMEM DROP COLUMN LEGAL_REGIMEN_TYPE;
