Browse Source

允许配置数据库名称

lixing 3 years ago
parent
commit
e65aaa0869
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/resources/bootstrap.yml

+ 2 - 1
src/main/resources/bootstrap.yml

@@ -20,7 +20,8 @@ spring:
           schema: classpath*:db/init/table.sql
           data: classpath*:db/init/data_dev.sql
           continue-on-error: true
-          url: jdbc:mysql://${mysql.ip}:${mysql.port}/${mysql.schema:energy_alarm_service}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+          # mysql_schema建议使用默认值。如果有特殊需求,建议在环境变量中配置该值
+          url: jdbc:mysql://${mysql.ip}:${mysql.port}/${mysql_schema:energy_alarm_service}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: ${mysql.username}
           password: ${mysql.password}
           driver-class-name: com.mysql.cj.jdbc.Driver