-- 
-- Estructura de tabla para la tabla `student_year_quota` 
-- 
 

CREATE TABLE IF NOT EXISTS `student_year_quota` ( 
  `serial_syq` int(11) NOT NULL AUTO_INCREMENT,   
  `serial_std` int(11) NOT NULL, 
  `serial_scy` int(11) NOT NULL, 
  `reserve_quota_syq` enum('YES','NO') DEFAULT NULL,
  `serial_usr` int(11) NOT NULL, 
  `ip_address_syq` varchar(45) NOT NULL,
  `insert_date_syq` datetime NOT NULL DEFAULT 0,
  `modification_date_syq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `finish_wizard_date_syq` datetime NULL DEFAULT NULL,
  `status_syq` enum('ACTIVE','INACTIVE') NOT NULL DEFAULT 'ACTIVE', 
  PRIMARY KEY (`serial_syq`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;



-- 
-- Filtros para la tabla `student_year_quota` 
-- 
ALTER TABLE `student_year_quota` 
  ADD CONSTRAINT `fk_syq_serial_std` FOREIGN KEY (`serial_std`) REFERENCES `student` (`serial_std`),
  ADD CONSTRAINT `fk_syq_serial_scy` FOREIGN KEY (`serial_scy`) REFERENCES `school_year` (`serial_scy`),
  ADD CONSTRAINT `fk_syq_serial_usr` FOREIGN KEY (`serial_usr`) REFERENCES `user` (`serial_usr`)
; 
