Skip to content

Commit

Permalink
rename the init.h2.sql to avoid loading wrong files in quick start mo…
Browse files Browse the repository at this point in the history
…de (#5034)

## What's the purpose of this PR

rename the init.h2.sql to avoid loading wrong files in quick start mode

## Which issue(s) this PR fixes:
Fixes #5033

## Brief changelog

add database prefix to the init.h2.sql files.
  • Loading branch information
nobodyiam authored Dec 6, 2023
1 parent b67db2b commit c01ac87
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public BizDBPropertySource(final ServerConfigRepository serverConfigRepository,
@PostConstruct
public void runSqlScript() throws Exception {
if (env.acceptsProfiles(Profiles.of("h2"))) {
Resource resource = new ClassPathResource("jpa/init.h2.sql");
Resource resource = new ClassPathResource("jpa/configdb.init.h2.sql");
if (resource.exists()) {
DatabasePopulatorUtils.execute(new ResourceDatabasePopulator(resource), dataSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public PortalDBPropertySource(final ServerConfigRepository serverConfigRepositor
@PostConstruct
public void runSqlScript() throws Exception {
if (env.acceptsProfiles(Profiles.of("h2"))) {
Resource resource = new ClassPathResource("jpa/init.h2.sql");
Resource resource = new ClassPathResource("jpa/portaldb.init.h2.sql");
if (resource.exists()) {
DatabasePopulatorUtils.execute(new ResourceDatabasePopulator(resource), dataSource);
}
Expand Down

0 comments on commit c01ac87

Please sign in to comment.