# 分库分表查询
/*
Navicat Premium Data Transfer
Source Server : bjgc
Source Server Type : MySQL
Source Server Version : 50650
Source Host : 10.83.128.202:3306
Source Schema : db-demo
Target Server Type : MySQL
Target Server Version : 50650
File Encoding : 65001
Date: 02/02/2021 11:46:17
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for yzm_table
-- ----------------------------
DROP TABLE IF EXISTS `yzm_table`;
CREATE TABLE `yzm_table` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '',
`content` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`yzm_table1`,`yzm_table2`);
-- ----------------------------
-- Table structure for yzm_table1
-- ----------------------------
DROP TABLE IF EXISTS `yzm_table1`;
CREATE TABLE `yzm_table1` (
`id` int(10) unsigned NOT NULL,
`title` varchar(100) NOT NULL DEFAULT '',
`content` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for yzm_table2
-- ----------------------------
DROP TABLE IF EXISTS `yzm_table2`;
CREATE TABLE `yzm_table2` (
`id` int(10) unsigned NOT NULL,
`title` varchar(100) NOT NULL DEFAULT '',
`content` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 远程主机表查询
/*
Navicat Premium Data Transfer
Source Server : bjgc
Source Server Type : MySQL
Source Server Version : 50650
Source Host : 10.83.128.202:3306
Source Schema : db-demo
Target Server Type : MySQL
Target Server Version : 50650
File Encoding : 65001
Date: 02/02/2021 11:45:16
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_index_zs
-- ----------------------------
DROP TABLE IF EXISTS `t_index_zs`;
CREATE TABLE `t_index_zs` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID',
`user_name` varchar(30) COLLATE utf8_bin NOT NULL COMMENT '用户账号',
`nick_name` varchar(30) COLLATE utf8_bin NOT NULL COMMENT '用户昵称',
`user_type` varchar(2) COLLATE utf8_bin DEFAULT '00' COMMENT '用户类型(00系统用户)',
`email` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '用户邮箱',
`phonenumber` varchar(11) COLLATE utf8_bin DEFAULT '' COMMENT '手机号码',
`sex` char(1) COLLATE utf8_bin DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)',
`avatar` varchar(100) COLLATE utf8_bin DEFAULT '' COMMENT '头像地址',
`password` varchar(100) COLLATE utf8_bin DEFAULT '' COMMENT '密码',
`status` char(1) COLLATE utf8_bin DEFAULT '0' COMMENT '帐号状态(0正常 1停用)',
`del_flag` char(1) COLLATE utf8_bin DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
`login_ip` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '最后登录IP',
`login_date` datetime DEFAULT NULL COMMENT '最后登录时间',
`create_by` varchar(64) COLLATE utf8_bin DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) COLLATE utf8_bin DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`user_id`)
) ENGINE=FEDERATED DEFAULT CHARSET=utf8 COLLATE=utf8_bin CONNECTION='mysql://root:lhadmin@qixin.bhgmarketplace.com:3306/ruoyi-vue-activit/sys_user';
SET FOREIGN_KEY_CHECKS = 1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 创建CSV表
DROP TABLE IF EXISTS `csv_table`;
CREATE TABLE `csv_table` (
`id` bigint(20) NOT NULL,
`name` varchar(100) NOT NULL
) /*!50100 STORAGE DISK */ ENGINE=CSV DEFAULT CHARSET=utf8;
1
2
3
4
5
2
3
4
5
注
创建的表会在data目录下生成csv文件,文件可以直接修改,一般文件有写保护,需要停止mysql后可直接修改文件。
# 默认日期
默认值:CURRENT_TIMESTAMP
根据当前时间截更新:选中