fix(test): use ddl-auto=create to prevent cross-context table drops

Multiple @SpringBootTest classes with different @MockBean configs
cause separate Spring contexts sharing the same H2 in-memory database.
With create-drop, one context's shutdown drops tables needed by another,
causing "Table not found (this database is empty)" errors.
This commit is contained in:
wowo-zZ 2026-04-12 15:10:54 +08:00
parent 0e4bc3b766
commit 4a7f021337

View file

@ -10,7 +10,7 @@ spring:
password:
jpa:
hibernate:
ddl-auto: create-drop
ddl-auto: create
database-platform: org.hibernate.dialect.H2Dialect
flyway:
enabled: false