ALTER TABLE `vn`.`ticketWeekly` ADD COLUMN `agencyModeFk` INT(11) NULL DEFAULT NULL AFTER `weekDay`, ADD INDEX `agencyModeFk_idx` (`agencyModeFk` ASC); ALTER TABLE `vn`.`ticketWeekly` ADD CONSTRAINT `agencyModeFk` FOREIGN KEY (`agencyModeFk`) REFERENCES `vn`.`agencyMode` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; ALTER TABLE `vn`.`ticketWeekly` CHANGE COLUMN `weekDay` `weekDay` TINYINT(1) NOT NULL COMMENT 'funcion de mysql Lunes = 0, Domingo = 6' ;