fix: resolve H2 database initialization issue
- Configure test profile to use H2 in-memory database - Add SQL initialization for schema and data - Ensure test environment works correctly Closes #1
This commit is contained in:
@@ -5,9 +5,9 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: manage-app
|
name: manage-app
|
||||||
r2dbc:
|
r2dbc:
|
||||||
url: r2dbc:postgresql://localhost:55432/manage_system
|
url: r2dbc:h2:mem:///testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
username: novalon
|
username: sa
|
||||||
password: novalon123
|
password:
|
||||||
pool:
|
pool:
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
max-size: 20
|
max-size: 20
|
||||||
@@ -15,12 +15,17 @@ spring:
|
|||||||
max-life-time: 1h
|
max-life-time: 1h
|
||||||
acquire-timeout: 5s
|
acquire-timeout: 5s
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://localhost:55432/manage_system
|
url: jdbc:h2:mem:///testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
username: novalon
|
username: sa
|
||||||
password: novalon123
|
password:
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.h2.Driver
|
||||||
flyway:
|
flyway:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
sql:
|
||||||
|
init:
|
||||||
|
mode: always
|
||||||
|
schema-locations: classpath:schema-h2.sql
|
||||||
|
data-locations: classpath:data-h2.sql
|
||||||
h2:
|
h2:
|
||||||
console:
|
console:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
Reference in New Issue
Block a user