/*
SQLyog Ultimate v11.27 (32 bit)
MySQL - 5.7.22-log : Database - swgk_wl
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`swgk_wl` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `swgk_wl`;

/*Table structure for table `party_documents` */

DROP TABLE IF EXISTS `party_documents`;

CREATE TABLE `party_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL COMMENT '原始文件名',
  `encode_name` varchar(100) NOT NULL COMMENT '转散列文件名',
  `orig_path` varchar(100) NOT NULL COMMENT '原始文件存储路径',
  `pdf_path` varchar(100) NOT NULL DEFAULT '' COMMENT '转PDF文件存储路径',
  `category_id` mediumint(8) unsigned NOT NULL COMMENT '文件分类ID',
  `extension` varchar(20) NOT NULL COMMENT '文件格式(后缀)',
  `size` int(10) unsigned NOT NULL COMMENT '文件大小',
  `operator_uuid` char(32) NOT NULL COMMENT '上传人UUID',
  `ctime` int(10) unsigned NOT NULL COMMENT '上传时间',
  `modifier_uuid` char(32) NOT NULL DEFAULT '' COMMENT '更新人UUID',
  `mtime` int(10) NOT NULL DEFAULT '0' COMMENT '最后更新时间',
  `version` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '当前文件版本',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COMMENT='文档表';

/*Data for the table `party_documents` */

insert  into `party_documents`(`id`,`name`,`encode_name`,`orig_path`,`pdf_path`,`category_id`,`extension`,`size`,`operator_uuid`,`ctime`,`modifier_uuid`,`mtime`,`version`) values (11,'newRegion201009','','/uploads/newRegion201009.xlsx','',1,'xlsx',37035,'30e9ff83d6b0490fa84c0c160f47e2bf',1602225116,'',0,1);

/*Table structure for table `party_documents_access` */

DROP TABLE IF EXISTS `party_documents_access`;

CREATE TABLE `party_documents_access` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表ID',
  `doc_id` int(10) unsigned NOT NULL COMMENT '文件ID',
  `uuid` char(32) NOT NULL COMMENT '用户UUID',
  `permission` enum('read','write','none') NOT NULL DEFAULT 'read' COMMENT '权限',
  `expire` int(10) unsigned NOT NULL COMMENT '有效期（整型），0表示永远有效',
  `ctime` int(10) unsigned NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='文档权限表';

/*Data for the table `party_documents_access` */

insert  into `party_documents_access`(`id`,`doc_id`,`uuid`,`permission`,`expire`,`ctime`) values (1,11,'30e9ff83d6b0490fa84c0c160f47e2bf','write',0,1234567890);

/*Table structure for table `party_documents_category` */

DROP TABLE IF EXISTS `party_documents_category`;

CREATE TABLE `party_documents_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表ID',
  `name` varchar(100) NOT NULL COMMENT '分类名称',
  `desc` varchar(100) NOT NULL COMMENT '分类描述',
  `operator_uuid` char(32) NOT NULL COMMENT '添加操作员UUID',
  `ctime` int(10) unsigned NOT NULL COMMENT '添加时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文档分类表';

/*Data for the table `party_documents_category` */

/*Table structure for table `party_documents_version` */

DROP TABLE IF EXISTS `party_documents_version`;

CREATE TABLE `party_documents_version` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表ID',
  `doc_id` int(10) unsigned NOT NULL COMMENT '文件ID',
  `version` int(10) unsigned NOT NULL COMMENT '版本号',
  `name` varchar(50) NOT NULL COMMENT '文件名',
  `size` int(10) unsigned NOT NULL COMMENT '文件大小',
  `path` char(100) NOT NULL COMMENT '文件路径',
  `ctime` int(10) unsigned NOT NULL COMMENT '版本创建时间',
  `creator_uuid` char(32) NOT NULL DEFAULT '' COMMENT '版本创建用户',
  `mtime` int(10) NOT NULL DEFAULT '0' COMMENT '版本更新时间',
  `modifier_uuid` char(32) NOT NULL DEFAULT '' COMMENT '版本更新用户',
  `extension` varchar(20) NOT NULL COMMENT '文件格式(后缀)',
  `remark` varchar(200) NOT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='文档历史表';

/*Data for the table `party_documents_version` */

insert  into `party_documents_version`(`id`,`doc_id`,`version`,`name`,`size`,`path`,`ctime`,`creator_uuid`,`mtime`,`modifier_uuid`,`extension`,`remark`) values (1,11,1,'newRegion201009',37035,'/uploads/newRegion201009.xlsx',1602225116,'30e9ff83d6b0490fa84c0c160f47e2bf',1602225116,'','xlsx','');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
