ALTER TABLE `student_year_quota` 
CHANGE COLUMN `reserve_quota_syq` `reserve_quota_syq` ENUM('YES', 'NO', 'DONTKNOW') NULL DEFAULT NULL ;

INSERT INTO `authority_charge` (`serial_atc`, `name_atc`, `description_atc`, `status_atc`) VALUES ('6', 'Director General', 'Director General', 'ACTIVE');
INSERT INTO `authority_charge` (`serial_atc`, `name_atc`, `description_atc`, `status_atc`) VALUES ('7', 'Director Ejecutivo', 'Director Ejecutivo', 'ACTIVE');

INSERT INTO `authority` (`serial_atc`, `id_aut`, `degree_aut`, `first_name_aut`, `last_name_aut`, `in_charge_aut`) VALUES ('6', '000000000', ' ', 'Patrick', 'Miller', 'YES');
INSERT INTO `authority` (`serial_atc`, `id_aut`, `degree_aut`, `first_name_aut`, `last_name_aut`, `in_charge_aut`) VALUES ('7', '000000000', ' ', 'Daniel', 'Berger', 'YES');

CREATE TABLE `authority_email` (
  `serial_ath` INT NOT NULL AUTO_INCREMENT,
  `serial_scy` INT NULL,
  `serial_set` INT NULL,
  `serial_lvl` INT NULL,
  `email_ath` VARCHAR(45) NULL,
  `description_ath` VARCHAR(45) NULL,
  `type_auth` SET('BURSAR','ADMITION') NULL,
  `status_ath` ENUM('ACTIVE', 'INACTIVE') NULL,
  PRIMARY KEY (`serial_ath`),
  INDEX `fk_ath_scy_idx` (`serial_scy` ASC),
  INDEX `fk_ath_set_idx` (`serial_set` ASC),
  INDEX `fk_ath_lvl_idx` (`serial_lvl` ASC),
  CONSTRAINT `fk_ath_scy`
    FOREIGN KEY (`serial_scy`)
    REFERENCES `school_year` (`serial_scy`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ath_set`
    FOREIGN KEY (`serial_set`)
    REFERENCES `section` (`serial_set`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ath_lvl`
    FOREIGN KEY (`serial_lvl`)
    REFERENCES `level` (`serial_lvl`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)ENGINE=InnoDB;
	ALTER TABLE `authority_email` 
CHANGE COLUMN `description_ath` `description_ath` TEXT NULL DEFAULT NULL ;

insert into  authority_email select null as serial_ath,serial_scy,serial_set,serial_lvl,'mcordovez@tomasmoro.k12.ec' as email_ath,'Email que se coloca en las cartas de pago en caso de que el email se envié a la persona equivocada' as description_ath,'BURSAR' as description_ath,'ACTIVE' as status_ath 
FROM level_section_year where serial_scy=9;
