CREATE TABLE IF NOT EXISTS `zt_gitfoxsynclog` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `objectType` enum('repo', 'user') NOT NULL DEFAULT 'user',
  `objectID` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `password` varchar(32) NOT NULL DEFAULT '',
  `status` enum('wait', 'synced', 'error') NOT NULL DEFAULT 'wait',
  `operate` enum('add', 'edit', 'del') NOT NULL DEFAULT 'add',
  `times` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `lastSync` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE INDEX `idx_status_object` ON `zt_gitfoxsynclog`(`status`, `objectType`, `objectID`);

INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`) VALUES ('*/5', '*', '*', '*', '*', 'moduleName=instance&methodName=syncGitFoxData', '同步GitFox数据', 'zentao', 1, 'normal');

ALTER TABLE `zt_repo` ADD `gitfoxID` varchar(255) NOT NULL DEFAULT '' AFTER `synced`;
