处理冲突

pull/16/head
AndrewFeng 2021-04-24 23:19:48 +08:00
parent 38c62ce5b6
commit d765c2439e
2 changed files with 4 additions and 3 deletions

View File

@ -47,7 +47,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
@Slf4j @Slf4j
public class FlywayInitListener implements ApplicationListener<ApplicationContextInitializedEvent>, Ordered { public class FlywayInitListener implements ApplicationListener<ApplicationContextInitializedEvent>, Ordered {
private static final String FLYWAY_LOCATIONS = "classpath:db/migration"; private static final String FLYWAY_LOCATIONS = "classpath:db/migration/mysql";
@Override @Override
public void onApplicationEvent(ApplicationContextInitializedEvent applicationEnvironmentPreparedEvent) { public void onApplicationEvent(ApplicationContextInitializedEvent applicationEnvironmentPreparedEvent) {
@ -60,7 +60,6 @@ public class FlywayInitListener implements ApplicationListener<ApplicationContex
String dataSourceUrl = environment.getProperty("spring.datasource.url"); String dataSourceUrl = environment.getProperty("spring.datasource.url");
String dataSourceUsername = environment.getProperty("spring.datasource.username"); String dataSourceUsername = environment.getProperty("spring.datasource.username");
String dataSourcePassword = environment.getProperty("spring.datasource.password"); String dataSourcePassword = environment.getProperty("spring.datasource.password");
String driverClassName = environment.getProperty("spring.datasource.driver-class-name");
// flyway的配置 // flyway的配置
String enabledStr = environment.getProperty("spring.flyway.enabled"); String enabledStr = environment.getProperty("spring.flyway.enabled");

View File

@ -42,7 +42,9 @@ public class CreateDatabaseSql extends AbstractSql {
@Override @Override
protected String sqlServer() { protected String sqlServer() {
return ""; return "if not exists (select * from sysobjects where name=? and xtype='U')\n" +
" create table ? ;" +
"go";
} }
@Override @Override