本文整理了Java中com.googlecode.flyway.core.Flyway.<init>()
方法的一些代码示例,展示了Flyway.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flyway.<init>()
方法的具体详情如下:
包路径:com.googlecode.flyway.core.Flyway
类名称:Flyway
方法名:<init>
[英]Creates a new instance of Flyway. This is your starting point.
[中]创建Flyway的新实例。这是你的出发点。
代码示例来源:origin: DeemOpen/zkui
public void checkNCreate() {
try {
Flyway flyway = new Flyway();
flyway.setDataSource(globalProps.getProperty("jdbcUrl"), globalProps.getProperty("jdbcUser"), globalProps.getProperty("jdbcPwd"));
//Will wipe db each time. Avoid this in prod.
if (globalProps.getProperty("env").equals("dev")) {
flyway.clean();
}
//Remove the above line if deploying to prod.
flyway.migrate();
} catch (Exception ex) {
logger.error("Error trying to migrate db! Not severe hence proceeding forward.");
}
}
代码示例来源:origin: minnal/minnal
public MigrationsPlugin() {
this(new Flyway());
}
代码示例来源:origin: ch.inftec.ju/ju-testing
@Override
public void execute(DataSource ds) {
Flyway flyway = new Flyway();
flyway.setDataSource(ds);
flyway.clean(); // FIXME: Try Liquibase.dropAll()
}
});
代码示例来源:origin: ch.inftec.ju/ju-testing
@Override
public void execute(DataSource ds) {
Flyway flyway = new Flyway();
flyway.setDataSource(ds);
flyway.setLocations(locations);
flyway.migrate();
}
});
代码示例来源:origin: com.googlecode.flyway-test-extensions/flyway-spring-test
Flyway toReturn = new Flyway();
setFlyway(toReturn);
代码示例来源:origin: com.googlecode.flyway-test-extensions/flyway-spring3-test
Flyway toReturn = new Flyway();
setFlyway(toReturn);
代码示例来源:origin: com.googlecode.flyway-test-extensions/flyway-spring4-test
Flyway toReturn = new Flyway();
setFlyway(toReturn);
代码示例来源:origin: SAP/olingo-jpa-processor-v4
Flyway flyway = new Flyway();
代码示例来源:origin: com.googlecode.flyway/flyway-commandline
Flyway flyway = new Flyway();
flyway.configure(properties);
代码示例来源:origin: org.jabylon/db.migration
private void migrateDB(DataSource dataSource)
{
boolean dbExists = dbExists(dataSource);
Flyway flyway = new Flyway();
flyway.setDataSource(dataSource);
flyway.setTable("SCHEMA_VERSION");
// flyway.setInitOnMigrate(true);
if (!dbExists)
{
MigrationVersion migrationVersion = getLatestVersion(flyway);
if (migrationVersion != null)
flyway.setInitVersion(migrationVersion);
}
MigrationInfo current = flyway.info().current();
if (current == null)
flyway.init();
flyway.migrate();
}
代码示例来源:origin: com.googlecode.flyway/flyway-ant
Flyway flyway = new Flyway();
代码示例来源:origin: jvelo/mayocat-shop
@Override
protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception
{
final DataSourceFactory dbConfig = strategy.getDataSourceFactory(configuration);
dbConfig.setMaxSize(1);
dbConfig.setMinSize(1);
Flyway flyway = new Flyway();
flyway.setLocations(MAYOAPP_MIGRATIONS);
flyway.setDataSource(dbConfig.getUrl(), dbConfig.getUser(), dbConfig.getPassword());
if (flyway.info().current() == null) {
flyway.setInitVersion("0000.0001");
flyway.init();
}
flyway.migrate();
}
}
内容来源于网络,如有侵权,请联系作者删除!