diff --git a/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-dev.yml b/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-dev.yml index abe86711..f95e8d75 100644 --- a/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-dev.yml +++ b/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-dev.yml @@ -8,7 +8,7 @@ spring.datasource: password: ${DB_PWD:123456} driver-class-name: com.mysql.cj.jdbc.Driver # # PostgreSQL 配置 -# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin_job}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&stringtype=unspecified +# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin_job}?options=-c%20TimeZone=Asia/Shanghai&sslmode=prefer&channelBinding=require&stringtype=unspecified # username: ${DB_USER:root} # password: ${DB_PWD:123456} # driver-class-name: org.postgresql.Driver diff --git a/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-prod.yml b/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-prod.yml index d38197fe..ebc71cce 100644 --- a/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-prod.yml +++ b/continew-extension/continew-extension-schedule-server/src/main/resources/config/application-prod.yml @@ -8,7 +8,7 @@ spring.datasource: password: ${DB_PWD:123456} driver-class-name: com.mysql.cj.jdbc.Driver # # PostgreSQL 配置 -# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin_job}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&stringtype=unspecified +# url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin_job}?options=-c%20TimeZone=Asia/Shanghai&sslmode=prefer&channelBinding=require&stringtype=unspecified # username: ${DB_USER:root} # password: ${DB_PWD:123456} # driver-class-name: org.postgresql.Driver diff --git a/continew-server/src/main/resources/config/application-dev.yml b/continew-server/src/main/resources/config/application-dev.yml index 3d109e52..23207f08 100644 --- a/continew-server/src/main/resources/config/application-dev.yml +++ b/continew-server/src/main/resources/config/application-dev.yml @@ -17,7 +17,7 @@ spring.datasource: password: ${DB_PWD:123456} driver-class-name: com.p6spy.engine.spy.P6SpyDriver # # PostgreSQL 配置 - # url: jdbc:p6spy:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&stringtype=unspecified + # url: jdbc:p6spy:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?options=-c%20TimeZone=Asia/Shanghai&sslmode=prefer&channelBinding=require&stringtype=unspecified # username: ${DB_USER:postgres} # password: ${DB_PWD:123456} # driver-class-name: com.p6spy.engine.spy.P6SpyDriver diff --git a/continew-server/src/main/resources/config/application-prod.yml b/continew-server/src/main/resources/config/application-prod.yml index 354bdeb5..195388e7 100644 --- a/continew-server/src/main/resources/config/application-prod.yml +++ b/continew-server/src/main/resources/config/application-prod.yml @@ -19,7 +19,7 @@ spring.datasource: password: ${DB_PWD:123456} driver-class-name: com.mysql.cj.jdbc.Driver # # PostgreSQL 配置 - # url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&stringtype=unspecified + # url: jdbc:postgresql://${DB_HOST:127.0.0.1}:${DB_PORT:5432}/${DB_NAME:continew_admin}?options=-c%20TimeZone=Asia/Shanghai&sslmode=prefer&channelBinding=require&stringtype=unspecified # username: ${DB_USER:postgres} # password: ${DB_PWD:123456} # driver-class-name: org.postgresql.Driver diff --git a/continew-server/src/main/resources/db/changelog/postgresql/plugin/plugin_tenant.sql b/continew-server/src/main/resources/db/changelog/postgresql/plugin/plugin_tenant.sql index 8a593328..1b1bd26d 100644 --- a/continew-server/src/main/resources/db/changelog/postgresql/plugin/plugin_tenant.sql +++ b/continew-server/src/main/resources/db/changelog/postgresql/plugin/plugin_tenant.sql @@ -137,22 +137,19 @@ COMMENT ON COLUMN "sys_app"."tenant_id" IS '租户ID'; CREATE INDEX "idx_app_tenant_id" ON "sys_app" ("tenant_id"); -- 调整唯一索引 -ALTER TABLE "sys_dept" DROP INDEX "uk_dept_name_parent_id"; +DROP INDEX IF EXISTS "uk_dept_name_parent_id"; CREATE UNIQUE INDEX "uk_dept_name_parent_id" ON "sys_dept" ("name", "parent_id", "tenant_id"); -ALTER TABLE "sys_role" DROP INDEX "uk_role_name"; -ALTER TABLE "sys_role" DROP INDEX "uk_role_code"; +DROP INDEX IF EXISTS "uk_role_name", "uk_role_code"; CREATE UNIQUE INDEX "uk_role_name" ON "sys_role" ("name", "tenant_id"); CREATE UNIQUE INDEX "uk_role_code" ON "sys_role" ("code", "tenant_id"); -ALTER TABLE "sys_user" DROP INDEX "uk_user_username"; -ALTER TABLE "sys_user" DROP INDEX "uk_user_email"; -ALTER TABLE "sys_user" DROP INDEX "uk_user_phone"; +DROP INDEX IF EXISTS "uk_user_username", "uk_user_email", "uk_user_phone"; CREATE UNIQUE INDEX "uk_user_username" ON "sys_user" ("username", "tenant_id"); CREATE UNIQUE INDEX "uk_user_email" ON "sys_user" ("email", "tenant_id"); CREATE UNIQUE INDEX "uk_user_phone" ON "sys_user" ("phone", "tenant_id"); -ALTER TABLE "sys_app" DROP INDEX "uk_app_access_key"; +DROP INDEX IF EXISTS "uk_app_access_key"; CREATE UNIQUE INDEX "uk_app_access_key" ON "sys_app" ("access_key", "tenant_id"); -- 初始化默认菜单