CREATE TABLE IF NOT EXISTS `shift_level_group` (
  `serial_slsy` INT NOT NULL AUTO_INCREMENT,
  `serial_sft` INT(11) NOT NULL,
  `serial_lgsy` INT NOT NULL,
  `status` ENUM('ACTIVE','INACTIVE') NOT NULL DEFAULT 'ACTIVE',
  `extracurricular` TINYINT(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`serial_slsy`),
  INDEX `fk_shift_level_section_year_shift1_idx` (`serial_sft` ASC),
  INDEX `fk_shift_level_section_year_level_group_school_year1_idx` (`serial_lgsy` ASC),
  CONSTRAINT `fk_shift_level_section_year_shift1`
    FOREIGN KEY (`serial_sft`)
    REFERENCES `shift` (`serial_sft`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_shift_level_section_year_level_group_school_year1`
    FOREIGN KEY (`serial_lgsy`)
    REFERENCES `level_group_school_year` (`serial_lgsy`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

ALTER TABLE `travel_student_day` ADD `selected` BOOLEAN NULL DEFAULT TRUE ;

ALTER TABLE `form_authorization` CHANGE `freepass` `freepass` ENUM('YES','NO') NULL DEFAULT NULL;

ALTER TABLE `employee_section` CHANGE `type_user` `type_user` ENUM('DIRECTOR','ASSISTANT','USER','TRANSPORTATION_COORDINATOR') NULL DEFAULT 'USER';

ALTER TABLE `form_authorization` CHANGE `reason` `reason` TEXT NOT NULL;

ALTER TABLE `form_authorization` 
ADD COLUMN `serial_reviser` INT(11) NULL DEFAULT NULL AFTER `change_type`,

ADD INDEX `fk_form_autorization_employee1_idx` (`serial_reviser` ASC);

ALTER TABLE `form_authorization` 
ADD CONSTRAINT `fk_form_autorization_employee1`
  FOREIGN KEY (`serial_reviser`)
  REFERENCES `employee` (`serial_emp`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;
