Skip to content

Commit ffe902b

Browse files
committed
修改SQL文件
1 parent cb42b9b commit ffe902b

File tree

4 files changed

+61
-59
lines changed

4 files changed

+61
-59
lines changed

springboot-11-jpa/src/main/resources/application.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ spring:
55
username: root
66
password: '123456'
77
schema:
8-
- classpath:sql/department.sql
9-
- classpath:sql/employee.sql
10-
initialization-mode: never
8+
- classpath:sql/springboot-jpa.sql
9+
initialization-mode: always
1110
type: com.alibaba.druid.pool.DruidDataSource #切换数据源为druid
1211
#数据源其他配置
1312
initialSize: 5 #数据库连接池初始化连接个数

springboot-11-jpa/src/main/resources/sql/department.sql

Lines changed: 0 additions & 27 deletions
This file was deleted.

springboot-11-jpa/src/main/resources/sql/employee.sql

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Navicat MySQL Data Transfer
3+
4+
Source Server : 127.0.0.1
5+
Source Server Version : 80013
6+
Source Host : localhost:3306
7+
Source Database : springboot-jpa
8+
9+
Target Server Type : MYSQL
10+
Target Server Version : 80013
11+
File Encoding : 65001
12+
13+
Date: 2019-01-21 16:01:11
14+
*/
15+
16+
SET FOREIGN_KEY_CHECKS=0;
17+
18+
-- ----------------------------
19+
-- Table structure for department
20+
-- ----------------------------
21+
DROP TABLE IF EXISTS `department`;
22+
CREATE TABLE `department` (
23+
`id` int(11) NOT NULL AUTO_INCREMENT,
24+
`department_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
25+
PRIMARY KEY (`id`)
26+
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
27+
28+
-- ----------------------------
29+
-- Records of department
30+
-- ----------------------------
31+
INSERT INTO `department` VALUES ('1', 'D-AA');
32+
INSERT INTO `department` VALUES ('2', 'D-BB');
33+
INSERT INTO `department` VALUES ('3', 'D-CC');
34+
INSERT INTO `department` VALUES ('4', 'D-DD');
35+
INSERT INTO `department` VALUES ('6', 'D-EE');
36+
37+
-- ----------------------------
38+
-- Table structure for employee
39+
-- ----------------------------
40+
DROP TABLE IF EXISTS `employee`;
41+
CREATE TABLE `employee` (
42+
`id` int(11) NOT NULL AUTO_INCREMENT,
43+
`last_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
44+
`email` varchar(255) DEFAULT NULL,
45+
`gender` int(2) DEFAULT NULL,
46+
`d_id` int(11) DEFAULT NULL,
47+
PRIMARY KEY (`id`)
48+
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
49+
50+
-- ----------------------------
51+
-- Records of employee
52+
-- ----------------------------
53+
INSERT INTO `employee` VALUES ('1', '张三', '哈哈@163.com', '1', '1');
54+
INSERT INTO `employee` VALUES ('2', '李4', '456@163.com', '0', '2');
55+
INSERT INTO `employee` VALUES ('3', '王5', '789@163.com', '1', '3');
56+
INSERT INTO `employee` VALUES ('4', '赵6', '123@123.com', '0', '4');
57+
INSERT INTO `employee` VALUES ('5', '田7', '456@123.com', '1', '6');
58+
INSERT INTO `employee` VALUES ('6', '王二麻子', '7879@123.com', '0', '1');
59+
INSERT INTO `employee` VALUES ('8', 'clown', 'clown@163.com', '0', '2');

0 commit comments

Comments
 (0)