use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method testTag.
@Test
public void testTag() throws Exception {
if (database == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
liquibase.update(this.contexts);
liquibase.tag("Test Tag");
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method testUnrunChangeSetsEmptyDatabase.
@Test
public void testUnrunChangeSetsEmptyDatabase() throws Exception {
if (database == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
List<ChangeSet> list = liquibase.listUnrunChangeSets(new Contexts(this.contexts), new LabelExpression());
assertTrue(list.size() > 0);
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class LiquibaseChangeLogSyncSQLMojo method createLiquibase.
@Override
protected Liquibase createLiquibase(ResourceAccessor fo, Database db) throws MojoExecutionException {
Liquibase liquibase = super.createLiquibase(fo, db);
// Setup the output file writer
try {
if (!migrationSqlOutputFile.exists()) {
// Ensure the parent directories exist
migrationSqlOutputFile.getParentFile().mkdirs();
// Create the actual file
if (!migrationSqlOutputFile.createNewFile()) {
throw new MojoExecutionException("Cannot create the migration SQL file; " + migrationSqlOutputFile.getAbsolutePath());
}
}
outputWriter = getOutputWriter(migrationSqlOutputFile);
;
} catch (IOException e) {
getLog().error(e);
throw new MojoExecutionException("Failed to create SQL output writer", e);
}
getLog().info("Output SQL Migration File: " + migrationSqlOutputFile.getAbsolutePath());
return liquibase;
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class LiquibaseFutureRollbackSQL method createLiquibase.
@Override
protected Liquibase createLiquibase(ResourceAccessor fo, Database db) throws MojoExecutionException {
Liquibase liquibase = super.createLiquibase(fo, db);
// Setup the output file writer
try {
if (!outputFile.exists()) {
// Ensure the parent directories exist
outputFile.getParentFile().mkdirs();
// Create the actual file
if (!outputFile.createNewFile()) {
throw new MojoExecutionException("Cannot create the output file; " + outputFile.getAbsolutePath());
}
}
outputWriter = getOutputWriter(outputFile);
} catch (IOException e) {
getLog().error(e);
throw new MojoExecutionException("Failed to create SQL output writer", e);
}
getLog().info("Output File: " + outputFile.getAbsolutePath());
return liquibase;
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class LiquibaseUpdateSQL method createLiquibase.
@Override
protected Liquibase createLiquibase(ResourceAccessor fo, Database db) throws MojoExecutionException {
Liquibase liquibase = super.createLiquibase(fo, db);
// Setup the output file writer
try {
if (!migrationSqlOutputFile.exists()) {
// Ensure the parent directories exist
migrationSqlOutputFile.getParentFile().mkdirs();
// Create the actual file
if (!migrationSqlOutputFile.createNewFile()) {
throw new MojoExecutionException("Cannot create the migration SQL file; " + migrationSqlOutputFile.getAbsolutePath());
}
}
outputWriter = getOutputWriter(migrationSqlOutputFile);
} catch (IOException e) {
getLog().error(e);
throw new MojoExecutionException("Failed to create SQL output writer", e);
}
getLog().info("Output SQL Migration File: " + migrationSqlOutputFile.getAbsolutePath());
return liquibase;
}
Aggregations