支持配置文件切换环境

This commit is contained in:
inrgihc
2024-10-18 22:49:50 +08:00
parent f3a51c2097
commit 35bd4c70ce
13 changed files with 103 additions and 120 deletions

View File

@@ -1,15 +1,4 @@
server:
port: 9088
spring:
application:
name: dbswitch-admin
tomcat:
uri-encoding: UTF-8
max-http-header-size: 8096
mvc:
throw-exception-if-no-handler-found: false
static-path-pattern: /statics/**
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.31.57:3306/dbswitch?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowMultiQueries=true&failOverReadOnly=false&connectTimeout=30000
@@ -22,14 +11,3 @@ spring:
baseline-on-migrate: true
table: DBSWITCH_SCHEMA_HISTORY
enabled: true
mybatis:
configuration:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:
drivers-base-path: ${APP_DRIVERS_PATH}

View File

@@ -0,0 +1,13 @@
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://192.168.31.57:5432/dbswitch?currentSchema=public
username: tangyibo
password: 123456
validation-query: SELECT 1
test-on-borrow: true
flyway:
locations: classpath:db/postgres
baseline-on-migrate: true
table: dbswitch_schema_history
enabled: true

View File

@@ -1,7 +1,7 @@
server:
port: 9088
spring:
profiles:
include: mysql
#include: postgres
application:
name: dbswitch-admin
tomcat:
@@ -10,18 +10,9 @@ spring:
mvc:
throw-exception-if-no-handler-found: false
static-path-pattern: /statics/**
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.31.57:3306/dbswitch?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useSSL=false&allowMultiQueries=true&failOverReadOnly=false&connectTimeout=30000
username: tangyibo
password: 123456
validation-query: SELECT 1
test-on-borrow: true
flyway:
locations: classpath:db/migration
baseline-on-migrate: true
table: DBSWITCH_SCHEMA_HISTORY
enabled: true
server:
port: 9088
mybatis:
configuration:

View File

@@ -1,35 +0,0 @@
server:
port: 9088
spring:
application:
name: dbswitch-admin
tomcat:
uri-encoding: UTF-8
max-http-header-size: 8096
mvc:
throw-exception-if-no-handler-found: false
static-path-pattern: /statics/**
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://192.168.31.57:5432/dbswitch?currentSchema=public
username: tangyibo
password: 123456
validation-query: SELECT 1
test-on-borrow: true
flyway:
locations: classpath:db/postgres
baseline-on-migrate: true
table: dbswitch_schema_history
enabled: true
mybatis:
configuration:
lazy-loading-enabled: true
aggressive-lazy-loading: false
map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
dbswitch:
configuration:
drivers-base-path: ${APP_DRIVERS_PATH}