Skip to content

Commit

Permalink
rename the init.h2.sql to avoid loading wrong files in quick start mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Dec 6, 2023
1 parent b67db2b commit ed34b97
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");

Check warning on line 70 in apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java

View check run for this annotation

Codecov / codecov/patch

apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java#L70

Added line #L70 was not covered by tests
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");

Check warning on line 66 in apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java

View check run for this annotation

Codecov / codecov/patch

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java#L66

Added line #L66 was not covered by tests
if (resource.exists()) {
DatabasePopulatorUtils.execute(new ResourceDatabasePopulator(resource), dataSource);
}
Expand Down

0 comments on commit ed34b97

Please sign in to comment.