fix: 使用Spring Boot原生sql.init自动建表
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-24 14:19:08 +00:00
parent e09440ba63
commit 8435048156
3 changed files with 32 additions and 101 deletions

View File

@@ -11,6 +11,15 @@ spring:
url: jdbc:postgresql://${SPRING_DATASOURCE_HOST:localhost}:${SPRING_DATASOURCE_PORT:5432}/${SPRING_DATASOURCE_DB:building_materials}
username: ${SPRING_DATASOURCE_USERNAME:postgres}
password: ${SPRING_DATASOURCE_PASSWORD:postgres}
hikari:
initialization-fail-timeout: 60000
# 自动执行建表SQL
sql:
init:
mode: always
schema-locations: classpath:sql/init.sql
continue-on-error: true
# Redis配置 - 环境变量注入
redis:
@@ -37,7 +46,6 @@ mybatis-plus:
logic-delete-field: status
logic-delete-value: 0
logic-not-delete-value: 1
# 自动建表
mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.example.building.entity