mirror of https://gitee.com/stylefeng/roses
处理冲突
parent
38c62ce5b6
commit
d765c2439e
|
@ -47,7 +47,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
|||
@Slf4j
|
||||
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
|
||||
public void onApplicationEvent(ApplicationContextInitializedEvent applicationEnvironmentPreparedEvent) {
|
||||
|
@ -60,7 +60,6 @@ public class FlywayInitListener implements ApplicationListener<ApplicationContex
|
|||
String dataSourceUrl = environment.getProperty("spring.datasource.url");
|
||||
String dataSourceUsername = environment.getProperty("spring.datasource.username");
|
||||
String dataSourcePassword = environment.getProperty("spring.datasource.password");
|
||||
String driverClassName = environment.getProperty("spring.datasource.driver-class-name");
|
||||
|
||||
// flyway的配置
|
||||
String enabledStr = environment.getProperty("spring.flyway.enabled");
|
||||
|
|
|
@ -42,7 +42,9 @@ public class CreateDatabaseSql extends AbstractSql {
|
|||
|
||||
@Override
|
||||
protected String sqlServer() {
|
||||
return "";
|
||||
return "if not exists (select * from sysobjects where name=? and xtype='U')\n" +
|
||||
" create table ? ;" +
|
||||
"go";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue