CREATE TABLE IF NOT EXISTS `zt_env` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `code` varchar(50) NOT NULL DEFAULT '',
  `system` varchar(255) NOT NULL DEFAULT '',
  `remoteID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
  `type` varchar(32) NOT NULL DEFAULT '',
  `desc` varchar(255) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `zt_host` ADD `CD` varchar(32) NOT NULL DEFAULT 'manual' AFTER `name`;
ALTER TABLE `zt_host` ADD `sshPort` mediumint NOT NULL DEFAULT 0 AFTER `ssh`;
ALTER TABLE `zt_host` ADD `remoteID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `name`;
ALTER TABLE `zt_host` MODIFY `admin` varchar(30) NOT NULL DEFAULT '0';

ALTER TABLE `zt_deploy` ADD `type` varchar(32) NOT NULL DEFAULT 'manual' AFTER `desc`;
ALTER TABLE `zt_deploy` ADD `env` mediumint(8) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `zt_deploy` ADD `app` mediumint(8) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `zt_deploy` ADD `releaseTPL` mediumint(8) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `zt_deploy` ADD `remoteID` mediumint(8) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `zt_deploy` ADD `lastReviewedBy` varchar(30) NOT NULL DEFAULT '';
ALTER TABLE `zt_deploy` ADD `lastReviewedDate` datetime NULL;
ALTER TABLE `zt_deploy` ADD `reviewedBy` varchar(255) NOT NULL DEFAULT '';
