Skip to content

Commit

Permalink
优化数据库
Browse files Browse the repository at this point in the history
  • Loading branch information
twelvet-s committed May 17, 2024
1 parent 12b3343 commit 64f6c9c
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 28 deletions.
8 changes: 0 additions & 8 deletions data/sql/twelvet-im.sql

This file was deleted.

6 changes: 3 additions & 3 deletions data/sql/twelvet.sql → data/sql/twelvet_mall.sql
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
DROP
DATABASE IF EXISTS `twelvet`;
DATABASE IF EXISTS `twelvet_mall`;

CREATE
DATABASE `twelvet` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
DATABASE `twelvet_mall` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

SET NAMES utf8mb4;
SET
FOREIGN_KEY_CHECKS = 0;

USE
`twelvet`;
`twelvet_mall`;

-- ----------------------------
-- Table structure for gen_table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
DROP DATABASE IF EXISTS `twelvet-goods`;
DROP DATABASE IF EXISTS `twelvet_mall_goods`;

CREATE DATABASE `twelvet-goods` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE `twelvet_mall_goods` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

USE `twelvet-goods`;
USE `twelvet_mall_goods`;

-- ----------------------------
-- Table structure for goods
Expand Down
8 changes: 8 additions & 0 deletions data/sql/twelvet_mall_im.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DROP DATABASE IF EXISTS `twelvet_mall_im`;

CREATE DATABASE `twelvet_mall_im` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

USE `twelvet_mall_im`;
2 changes: 1 addition & 1 deletion data/sql/twelvet_job.sql → data/sql/twelvet_mall_job.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USE `twelvet`;
USE `twelvet_mall`;

DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
Expand Down
20 changes: 10 additions & 10 deletions data/sql/twelvet_nacos.sql

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions data/sql/twelvet_seata.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
USE `twelvet_mall`;

-- 分布式事务

-- ----------------------------
Expand Down
2 changes: 1 addition & 1 deletion docker/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ usage() {
init() {
# copy sql
echo "begin copy sql "
cp ../data/sql/twelvet.sql ./mysql/db
cp ../data/sql/twelvet_mall.sql ./mysql/db
cp ../data/sql/twelvet_nacos.sql ./mysql/db

# copy jar
Expand Down
2 changes: 1 addition & 1 deletion docker/mysql/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# 执行sql脚本
COPY ./db/twelvet_nacos.sql /docker-entrypoint-initdb.d/
COPY ./db/twelvet.sql /docker-entrypoint-initdb.d/
COPY ./db/twelvet_mall.sql /docker-entrypoint-initdb.d/
2 changes: 1 addition & 1 deletion twelvet-nacos/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ db:
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:123456}
url:
0: jdbc:mysql://${MYSQL_HOST:twelvet-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:twelvet_nacos}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
0: jdbc:mysql://${MYSQL_HOST:twelvet-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:twelvet_mall_nacos}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true

nacos:
core:
Expand Down

0 comments on commit 64f6c9c

Please sign in to comment.