添加sql文件。

master
李亚楠 5 years ago
parent 4882bacdb2
commit 5cddd2693f
  1. 56
      db/dynamic_all.sql
  2. 96
      db/sharding_all.sql
  3. 4
      pom.xml

@ -1,56 +0,0 @@
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 8.0.18 - MySQL Community Server - GPL
-- 服务器OS: Win64
-- HeidiSQL 版本: 10.2.0.5599
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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' */;
-- Dumping database structure for master
CREATE DATABASE IF NOT EXISTS `master` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `master`;
-- Dumping structure for table master.user
CREATE TABLE IF NOT EXISTS `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '用户名',
`password` varchar(100) DEFAULT NULL COMMENT '密码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户';
-- Dumping data for table master.user: ~0 rows (大约)
DELETE FROM `user`;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` (`id`, `username`, `password`) VALUES
(1, 'admin', '123456');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
-- Dumping database structure for slave
CREATE DATABASE IF NOT EXISTS `slave` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `slave`;
-- Dumping structure for table slave.menu
CREATE TABLE IF NOT EXISTS `menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
`url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=311 DEFAULT CHARSET=utf8 COMMENT='菜单';
-- Dumping data for table slave.menu: ~0 rows (大约)
DELETE FROM `menu`;
/*!40000 ALTER TABLE `menu` DISABLE KEYS */;
INSERT INTO `menu` (`id`, `name`, `url`) VALUES
(1, '系统管理', 'index.html');
/*!40000 ALTER TABLE `menu` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

@ -0,0 +1,96 @@
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 8.0.18 - MySQL Community Server - GPL
-- 服务器OS: Win64
-- HeidiSQL 版本: 10.2.0.5599
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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' */;
-- Dumping database structure for ds0
CREATE DATABASE IF NOT EXISTS `ds0` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `ds0`;
-- Dumping structure for table ds0.t_order0
CREATE TABLE IF NOT EXISTS `t_order0` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`descr` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=424525194623713281 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';
-- Dumping data for table ds0.t_order0: ~4 rows (大约)
DELETE FROM `t_order0`;
/*!40000 ALTER TABLE `t_order0` DISABLE KEYS */;
INSERT INTO `t_order0` (`id`, `user_id`, `descr`) VALUES
(424521294483030016, 0, '测试'),
(424521294512390144, 0, '测试'),
(424525194590158848, 0, '测试'),
(424525194623713280, 0, '测试');
/*!40000 ALTER TABLE `t_order0` ENABLE KEYS */;
-- Dumping structure for table ds0.t_order1
CREATE TABLE IF NOT EXISTS `t_order1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`descr` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=424525194640490498 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';
-- Dumping data for table ds0.t_order1: ~8 rows (大约)
DELETE FROM `t_order1`;
/*!40000 ALTER TABLE `t_order1` DISABLE KEYS */;
INSERT INTO `t_order1` (`id`, `user_id`, `descr`) VALUES
(424521163633328129, 0, '测试'),
(424521185099776001, 0, '测试'),
(424521294285897729, 0, '测试'),
(424521294499807233, 0, '测试'),
(424521294520778753, 0, '测试'),
(424525194317529089, 0, '测试'),
(424525194606936065, 0, '测试'),
(424525194640490497, 0, '测试');
/*!40000 ALTER TABLE `t_order1` ENABLE KEYS */;
-- Dumping database structure for ds1
CREATE DATABASE IF NOT EXISTS `ds1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `ds1`;
-- Dumping structure for table ds1.t_order0
CREATE TABLE IF NOT EXISTS `t_order0` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`descr` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';
-- Dumping data for table ds1.t_order0: ~0 rows (大约)
DELETE FROM `t_order0`;
/*!40000 ALTER TABLE `t_order0` DISABLE KEYS */;
/*!40000 ALTER TABLE `t_order0` ENABLE KEYS */;
-- Dumping structure for table ds1.t_order1
CREATE TABLE IF NOT EXISTS `t_order1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`descr` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=424521077465546754 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';
-- Dumping data for table ds1.t_order1: ~0 rows (大约)
DELETE FROM `t_order1`;
/*!40000 ALTER TABLE `t_order1` DISABLE KEYS */;
INSERT INTO `t_order1` (`id`, `user_id`, `descr`) VALUES
(424520887190945793, 1, '测试'),
(424520920485330945, 1, '测试'),
(424521077465546753, 1, '测试');
/*!40000 ALTER TABLE `t_order1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

@ -9,9 +9,9 @@
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>com.dreamlyn</groupId> <groupId>com.dreamlyn</groupId>
<artifactId>dynamic</artifactId> <artifactId>sharding</artifactId>
<version>0.0.1</version> <version>0.0.1</version>
<name>dynamic</name> <name>sharding</name>
<description>动态数据源代码示例</description> <description>动态数据源代码示例</description>
<properties> <properties>

Loading…
Cancel
Save