ALTER TABLE `vn`.`zoneGeo` 
RENAME TO  `vn`.`zoneIncluded` ;

ALTER TABLE `vn`.`zoneNest` 
RENAME TO  `vn`.`zoneGeo` ;

ALTER TABLE `vn`.`zone` 
CHANGE COLUMN `agencyFk` `agencyModeFk` INT(11) NOT NULL,
CHANGE COLUMN `hour` `hour` DATETIME NOT NULL,
CHANGE COLUMN `warehouseFk` `warehouseFk` SMALLINT(6) UNSIGNED NOT NULL ;

ALTER TABLE `vn`.`zone` 
ADD INDEX `fk_zone_1_idx` (`warehouseFk` ASC),
ADD INDEX `fk_zone_2_idx` (`agencyModeFk` ASC);
ALTER TABLE `vn`.`zone` 
ADD CONSTRAINT `fk_zone_1`
  FOREIGN KEY (`warehouseFk`)
  REFERENCES `vn2008`.`warehouse` (`id`)
  ON DELETE NO ACTION
  ON UPDATE CASCADE,
ADD CONSTRAINT `fk_zone_2`
  FOREIGN KEY (`agencyModeFk`)
  REFERENCES `vn2008`.`Agencias` (`Id_Agencia`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;
