Pongo el esquema de mi bd
Código:
CREATE TABLE calendar` ( `id` INT NOT NULL , `date` DATE NOT NULL , `status_day` ENUM('active', 'not_active') NOT NULL DEFAULT active , `status_year` ENUM('active', 'not_active') NULL , `sy` INT NOT NULL , `created_date` DATETIME NULL , PRIMARY KEY (`id`) , INDEX `fk_att_calendar_1_idx` (`sy` ASC) , CONSTRAINT `fk_att_calendar_1` FOREIGN KEY (`sy` ) REFERENCES `iabcis`.`school_year` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;