SET @@sql_mode='';
SET NAMES utf8;-- DROP TABLE IF EXISTS `zt_acl`;
CREATE TABLE IF NOT EXISTS `zt_acl` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`account` char(30) NOT NULL,
`objectType` char(30) NOT NULL,
`objectID` mediumint(9) NOT NULL DEFAULT '0',
`type` char(40) NOT NULL DEFAULT 'whitelist',
`source` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_action`;
CREATE TABLE IF NOT EXISTS `zt_action` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`objectType` varchar(30) NOT NULL DEFAULT '',
`objectID` mediumint(8) unsigned NOT NULL DEFAULT '0',
`product` text NOT NULL,
`project` mediumint(8) unsigned NOT NULL,
`execution` mediumint(8) unsigned NOT NULL,
`actor` varchar(100) NOT NULL DEFAULT '',
`action` varchar(80) NOT NULL DEFAULT '',
`date` datetime NOT NULL,
`comment` text NOT NULL,
`extra` text,
`read` enum('0','1') NOT NULL DEFAULT '0',
`vision` varchar(10) NOT NULL DEFAULT 'rnd',
`efforted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `date` (`date`),
KEY `actor` (`actor`),
KEY `project` (`project`),
KEY `action` (`action`),
KEY `objectID` (`objectID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_api_lib_release`;
CREATE TABLE IF NOT EXISTS `zt_api_lib_release` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`lib` int UNSIGNED NOT NULL DEFAULT 0,
`desc` varchar(255) NOT NULL DEFAULT '',
`version` varchar(255) NOT NULL DEFAULT '',
`snap` mediumtext NOT NULL,
`addedBy` varchar(30) NOT NULL DEFAULT 0,
`addedDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_api`;
CREATE TABLE IF NOT EXISTS `zt_api` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`product` varchar(255) NOT NULL DEFAULT '',
`lib` int UNSIGNED NOT NULL DEFAULT 0,
`module` int UNSIGNED NOT NULL DEFAULT 0,
`title` varchar(100) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`protocol` varchar(10) NOT NULL DEFAULT '',
`method` varchar(10) NOT NULL DEFAULT '',
`requestType` varchar(100) NOT NULL DEFAULT '',
`responseType` varchar(100) NOT NULL DEFAULT '',
`status` varchar(20) NOT NULL DEFAULT '',
`owner` varchar(30) NOT NULl DEFAULT 0,
`desc` mediumtext NULL,
`version` smallint UNSIGNED NOT NULL DEFAULT 0,
`params` text NULL,
`paramsExample` text NUll,
`responseExample` text NUll,
`response` text NULL,
`commonParams` text NULL,
`addedBy` varchar(30) NOT NULL DEFAULT 0,
`addedDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL DEFAULT 0,
`editedDate` datetime NOT NULL,
`deleted` enum ('0', '1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_apispec`;
CREATE TABLE IF NOT EXISTS `zt_apispec` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`doc` int UNSIGNED NOT NULL DEFAULT 0,
`module` int UNSIGNED NOT NULL DEFAULT 0,
`title` varchar(100) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`protocol` varchar(10) NOT NULL DEFAULT '',
`method` varchar(10) NOT NULL DEFAULT '',
`requestType` varchar(100) NOT NULL DEFAULT '',
`responseType` varchar(100) NOT NULL DEFAULT '',
`status` varchar(20) NOT NULL DEFAULT '',
`owner` varchar(255) NOT NULl DEFAULT 0,
`desc` mediumtext NULL,
`version` smallint UNSIGNED NOT NULL DEFAULT 0,
`params` text NULL,
`paramsExample` text NUll,
`responseExample` text NUll,
`response` text NULL,
`addedBy` varchar(30) NOT NULL DEFAULT 0,
`addedDate` datetime NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_apistruct`;
CREATE TABLE IF NOT EXISTS `zt_apistruct` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`lib` int UNSIGNED NOT NULL DEFAULT 0,
`name` varchar(30) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`desc` mediumtext NOT NULL,
`version` smallint unsigned NOT NULL DEFAULT 0,
`attribute` text NULL,
`addedBy` varchar(30) NOT NULL DEFAULT 0,
`addedDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL DEFAULT 0,
`editedDate` datetime NOT NULL,
`deleted` enum ('0', '1') NOT NULL DEFAULT '0',
primary key (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_apistruct_spec`;
CREATE TABLE IF NOT EXISTS `zt_apistruct_spec` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT '',
`desc` varchar(255) NOT NULL DEFAULT '',
`attribute` text NULL,
`version` smallint unsigned NOT NULL DEFAULT 0,
`addedBy` varchar(30) NOT NULL DEFAULT 0,
`addedDate` datetime NOT NULL,
primary key (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approval`;
CREATE TABLE IF NOT EXISTS `zt_approval` (
`id` mediumint(8) NOT NULL AUTO_INCREMENT,
`flow` mediumint(8) NOT NULL,
`objectType` varchar(30) NOT NULL,
`objectID` mediumint(9) NOT NULL,
`nodes` mediumtext NOT NULL,
`version` mediumint(9) NOT NULL,
`status` varchar(20) NOT NULL DEFAULT 'doing',
`result` varchar(20) NOT NULL,
`createdBy` char(30) NOT NULL,
`createdDate` datetime NOT NULL,
`deleted` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalflow`;
CREATE TABLE IF NOT EXISTS `zt_approvalflow` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`code` varchar(100) NOT NULL,
`desc` mediumtext NOT NULL,
`version` mediumint(8) NOT NULL DEFAULT '1',
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
`type` varchar(30) NOT NULL,
`deleted` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalflowobject`;
CREATE TABLE IF NOT EXISTS `zt_approvalflowobject` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`root` int(8) NOT NULL,
`flow` int(8) NOT NULL,
`objectType` char(30) NOT NULL,
`objectID` mediumint(9) NOT NULL,
`extra` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalflowspec`;
CREATE TABLE IF NOT EXISTS `zt_approvalflowspec` (
`id` mediumint(8) NOT NULL AUTO_INCREMENT,
`flow` mediumint(8) NOT NULL,
`version` mediumint(8) NOT NULL,
`nodes` mediumtext NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalnode`;
CREATE TABLE IF NOT EXISTS `zt_approvalnode` (
`id` mediumint(8) NOT NULL AUTO_INCREMENT,
`approval` mediumint(8) NOT NULL,
`type` enum('review','cc') NOT NULL,
`title` varchar(255) NOT NULL,
`account` char(30) NOT NULL,
`node` varchar(100) NOT NULL,
`reviewType` varchar(100) NOT NULL DEFAULT 'manual',
`multipleType` enum('and','or') NOT NULL DEFAULT 'and',
`prev` mediumtext NOT NULL,
`next` mediumtext NOT NULL,
`status` varchar(20) NOT NULL DEFAULT 'wait',
`result` varchar(10) NOT NULL,
`date` date NOT NULL,
`opinion` mediumtext NOT NULL,
`extra` mediumtext NOT NULL,
`reviewedBy` char(30) NOT NULL,
`reviewedDate` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_reviewed_date` (`reviewedDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalobject`;
CREATE TABLE IF NOT EXISTS `zt_approvalobject` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`approval` int(8) NOT NULL,
`objectType` char(30) NOT NULL,
`objectID` mediumint(8) NOT NULL,
`extra` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_approvalrole`;
CREATE TABLE IF NOT EXISTS `zt_approvalrole` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`code` char(30) NOT NULL,
`name` varchar(255) NOT NULL,
`desc` text NOT NULL,
`users` longtext NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAU