本文整理汇总了Java中liquibase.structure.core.Column类的典型用法代码示例。如果您正苦于以下问题:Java Column类的具体用法?Java Column怎么用?Java Column使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Column类属于liquibase.structure.core包,在下文中一共展示了Column类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(RemoveChangeSetRanStatusStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ChangeSet changeSet = statement.getChangeSet();
String tmpTable = UUID.randomUUID().toString().replaceAll("-", "");
String catalogName = database.getLiquibaseCatalogName();
String schemaName = database.getDefaultSchemaName();
String tableName = database.getDatabaseChangeLogTableName();
CreateTableAsSelectStatement createTableAsSelectStatement = new CreateTableAsSelectStatement(catalogName, schemaName, tableName, tmpTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "TAG", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(database.escapeObjectName("ID", Column.class) + " != ? " +
"AND " + database.escapeObjectName("FILENAME", Column.class) + " != ?")
.addWhereParameters(changeSet.getId(), changeSet.getFilePath());
return CustomSqlGenerator.generateSql(database,
createTableAsSelectStatement,
new DropTableStatement(catalogName, schemaName, tableName, false),
new RenameTableStatement(catalogName, schemaName, tmpTable, tableName));
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:19,代码来源:HiveRemoveChangeSetRanStatusGenerator.java
示例2: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(TagDatabaseStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
String catalogName = database.getLiquibaseCatalogName();
String schemaName = database.getDefaultSchemaName();
String tableName = database.getDatabaseChangeLogTableName();
String tableNameEscaped = database.escapeObjectName(tableName, Table.class);
String dateColumnNameEscaped = database.escapeObjectName("DATEEXECUTED", Column.class);
String tagColumnNameEscaped = database.escapeObjectName("TAG", Column.class);
String tempTable = UUID.randomUUID().toString().replaceAll("-", "");
CreateTableAsSelectStatement createTableAsSelectStatement = new CreateTableAsSelectStatement(catalogName, schemaName, tableName, tempTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "TAG", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(tableNameEscaped + "." + dateColumnNameEscaped + " NOT IN (SELECT MAX(" + tableNameEscaped + "." + dateColumnNameEscaped + ") " +
"FROM " + tableNameEscaped + ")");
InsertAsSelectStatement insertAsSelectStatement = new InsertAsSelectStatement(catalogName, schemaName, tableName, tempTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "'" + statement.getTag() + "'", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(tableNameEscaped + "." + dateColumnNameEscaped + " IN (SELECT MAX(" + tableNameEscaped + "." + dateColumnNameEscaped + ") FROM " + tableNameEscaped + ") AND ("
+ tableNameEscaped + "." + tagColumnNameEscaped + " IS NULL OR " + tableNameEscaped + "." + tagColumnNameEscaped + " != ?)").addWhereParameters(statement.getTag());
return CustomSqlGenerator.generateSql(database,
createTableAsSelectStatement,
insertAsSelectStatement,
new DropTableStatement(catalogName, schemaName, tableName, false),
new RenameTableStatement(catalogName, schemaName, tempTable, tableName));
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:25,代码来源:HiveTagDatabaseGenerator.java
示例3: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(RemoveChangeSetRanStatusStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ChangeSet changeSet = statement.getChangeSet();
String tmpTable = UUID.randomUUID().toString().replaceAll("-", "");
String catalogName = database.getLiquibaseCatalogName();
String schemaName = database.getDefaultSchemaName();
String tableName = database.getDatabaseChangeLogTableName();
CreateTableAsSelectStatement createTableAsSelectStatement = new CreateTableAsSelectStatement(catalogName, schemaName, tableName, tmpTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "TAG", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(" NOT (" + database.escapeObjectName("ID", Column.class) + " = ? " +
"AND " + database.escapeObjectName("FILENAME", Column.class) + " = ?)")
.addWhereParameters(changeSet.getId(), changeSet.getFilePath());
return CustomSqlGenerator.generateSql(database,
UserSessionSettings.syncDdlStart(),
createTableAsSelectStatement,
new DropTableStatement(catalogName, schemaName, tableName, false),
new RenameTableStatement(catalogName, schemaName, tmpTable, tableName),
UserSessionSettings.syncDdlStop());
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:21,代码来源:ImpalaRemoveChangeSetRanStatusGenerator.java
示例4: generateInsertMetadataSql
import liquibase.structure.core.Column; //导入依赖的package包/类
/**
* Generates the SQL for inserting the necessary record into the
* <code>USER_SDO_GEOM_METADATA</code> table. This record must be present prior to creating the
* spatial index.
*
* @param statement
* the create spatial index statement.
* @param database
* the database instance.
* @return the SQL to insert the metadata record.
*/
protected String generateInsertMetadataSql(final CreateSpatialIndexStatement statement,
final Database database) {
final StringBuilder sql = new StringBuilder();
sql.append("INSERT INTO user_sdo_geom_metadata ");
sql.append("(table_name, column_name, diminfo, srid) ");
final String tableName = statement.getTableName().trim();
sql.append("VALUES ('").append(database.correctObjectName(tableName, Table.class));
final String columnName = statement.getColumns()[0].trim();
sql.append("', '").append(database.correctObjectName(columnName, Column.class));
sql.append("', SDO_DIM_ARRAY(");
sql.append("SDO_DIM_ELEMENT('Longitude', -180, 180, 0.005), ");
sql.append("SDO_DIM_ELEMENT('Latitude', -90, 90, 0.005))");
final Integer srid = statement.getSrid();
if (srid == null) {
sql.append(", NULL");
} else {
sql.append(", ").append(OracleSpatialUtils.EPSG_TO_ORACLE_FUNCTION).append("(")
.append(srid).append(")");
}
sql.append(")");
return sql.toString();
}
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:34,代码来源:CreateSpatialIndexGeneratorOracle.java
示例5: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(final DropColumnStatement statement, final Database database,
final SqlGeneratorChain sqlGeneratorChain) {
String schemaName = statement.getSchemaName();
if (schemaName == null) {
schemaName = database.getDefaultSchemaName();
}
final String tableName = statement.getTableName();
final String columnName = statement.getColumnName();
final boolean isGeometryColumn = GeometryColumnsUtils.isGeometryColumn(database, schemaName,
tableName, columnName);
final List<Sql> list = new ArrayList<Sql>();
if (isGeometryColumn) {
dropSpatialIndexIfExists(statement.getCatalogName(), schemaName, tableName, database, list);
final String sql = "CALL DropGeometryColumn('" + schemaName + "', '" + tableName + "', '"
+ columnName + "')";
final Column column = getAffectedColumn(statement);
final Sql dropGeometryColumn = new UnparsedSql(sql, column);
list.add(dropGeometryColumn);
} else {
list.addAll(Arrays.asList(sqlGeneratorChain.generateSql(statement, database)));
}
return list.toArray(new Sql[list.size()]);
}
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:26,代码来源:DropGeometryColumnGeneratorGeoDB.java
示例6: getIndexExample
import liquibase.structure.core.Column; //导入依赖的package包/类
/**
* Generates the {@link Index} example (taken from {@link IndexExistsPrecondition}).
*
* @param database
* the database instance.
* @param schema
* the schema instance.
* @param tableName
* the table name of the index.
* @return the index example.
*/
protected Index getIndexExample(final Database database, final Schema schema,
final String tableName) {
final Index example = new Index();
if (tableName != null) {
example.setTable((Table) new Table().setName(
database.correctObjectName(getTableName(), Table.class)).setSchema(schema));
}
example.setName(database.correctObjectName(getIndexName(), Index.class));
if (StringUtils.trimToNull(getColumnNames()) != null) {
for (final String columnName : getColumnNames().split("\\s*,\\s*")) {
final Column column = new Column(database.correctObjectName(columnName, Column.class));
example.getColumns().add(column);
}
}
return example;
}
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:28,代码来源:SpatialIndexExistsPrecondition.java
示例7: check
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public void check(Database database) throws CustomPreconditionFailedException, CustomPreconditionErrorException {
Column column = new Column(this.columnNames);
UniqueConstraint uniqueConstraint = new UniqueConstraint(this.constraintName, null, null, this.tableName, column);
boolean markFailed = false;
try {
if (!SnapshotGeneratorFactory.getInstance().has(uniqueConstraint, database)) {
markFailed = true;
}
} catch (Exception e) {
throw new CustomPreconditionErrorException("custom precondition check errored", e);
}
if (markFailed) {
throw new CustomPreconditionFailedException(this.constraintName + " doesn't exist");
}
}
开发者ID:aerogear,项目名称:aerogear-unifiedpush-server,代码行数:18,代码来源:UniqueConstraintExistsCheck.java
示例8: generateMultipleColumnSql
import liquibase.structure.core.Column; //导入依赖的package包/类
private Sql[] generateMultipleColumnSql(DropColumnStatement dropColumnStatement, Database database, Map<String, String> columnsPreserved) {
if (columnsPreserved == null) {
throw new UnexpectedLiquibaseException("no columns to preserve");
}
List<Sql> result = new ArrayList<Sql>();
Map<String, String> columnsPreservedCopy = new HashMap<String, String>(columnsPreserved);
String alterTable;
List<DropColumnStatement> columns = null;
if (dropColumnStatement.isMultiple()) {
columns = dropColumnStatement.getColumns();
for (DropColumnStatement statement : columns) {
columnsPreservedCopy.remove(statement.getColumnName());
}
alterTable = "ALTER TABLE " + database.escapeTableName(columns.get(0).getCatalogName(), columns.get(0).getSchemaName(), columns.get(0).getTableName()) + " REPLACE COLUMNS (";
} else {
columnsPreservedCopy.remove(dropColumnStatement.getColumnName());
alterTable = "ALTER TABLE " + database.escapeTableName(dropColumnStatement.getCatalogName(), dropColumnStatement.getSchemaName(), dropColumnStatement.getTableName()) + " REPLACE COLUMNS (";
}
int i = 0;
for (String columnName : columnsPreservedCopy.keySet()) {
alterTable += database.escapeObjectName(columnName, Column.class) + " " + columnsPreservedCopy.get(columnName);
if (i < columnsPreservedCopy.size() - 1) {
alterTable += ",";
} else {
alterTable += ")";
}
i++;
}
if (dropColumnStatement.isMultiple()) {
result.add(new UnparsedSql(alterTable, getAffectedColumns(columns)));
} else {
result.add(new UnparsedSql(alterTable, getAffectedColumn(dropColumnStatement)));
}
return result.toArray(new Sql[result.size()]);
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:39,代码来源:HiveDropColumnGenerator.java
示例9: getAffectedColumns
import liquibase.structure.core.Column; //导入依赖的package包/类
private Column[] getAffectedColumns(List<DropColumnStatement> columns) {
List<Column> affected = new ArrayList<Column>();
for (DropColumnStatement column : columns) {
affected.add(getAffectedColumn(column));
}
return affected.toArray(new Column[affected.size()]);
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:HiveDropColumnGenerator.java
示例10: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(TagDatabaseStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
String catalogName = database.getLiquibaseCatalogName();
String schemaName = database.getDefaultSchemaName();
String tableName = database.getDatabaseChangeLogTableName();
String tableNameEscaped = database.escapeTableName(catalogName, schemaName, tableName);
String dateColumnNameEscaped = database.escapeObjectName("DATEEXECUTED", Column.class);
String tagColumnNameEscaped = database.escapeObjectName("TAG", Column.class);
String tmpTable = UUID.randomUUID().toString().replaceAll("-", "");
CreateTableAsSelectStatement createTableAsSelectStatement = new CreateTableAsSelectStatement(catalogName, schemaName, tableName, tmpTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "TAG", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(dateColumnNameEscaped + " != (SELECT MAX(" + dateColumnNameEscaped + ") " +
"FROM " + tableNameEscaped + ")");
InsertAsSelectStatement insertAsSelectStatement = new InsertAsSelectStatement(database.getLiquibaseCatalogName(), database.getLiquibaseSchemaName(), database.getDatabaseChangeLogTableName(), tmpTable)
.addColumnNames("ID", "AUTHOR", "FILENAME", "DATEEXECUTED", "ORDEREXECUTED", "EXECTYPE", "MD5SUM", "DESCRIPTION", "COMMENTS", "'" + statement.getTag() + "'", "LIQUIBASE", "CONTEXTS", "LABELS", "DEPLOYMENT_ID")
.setWhereCondition(dateColumnNameEscaped + " = (SELECT MAX(" + dateColumnNameEscaped + ") FROM " + tableNameEscaped + ") AND ("
+ tagColumnNameEscaped + " IS NULL OR " + tagColumnNameEscaped + " != ?)")
.addWhereParameters(statement.getTag());
return CustomSqlGenerator.generateSql(database,
UserSessionSettings.syncDdlStart(),
createTableAsSelectStatement,
insertAsSelectStatement,
new DropTableStatement(catalogName, schemaName, tableName, false),
new RenameTableStatement(catalogName, schemaName, tmpTable, tableName),
UserSessionSettings.syncDdlStop());
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:28,代码来源:ImpalaTagDatabaseGenerator.java
示例11: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(final DropSpatialIndexStatement statement, final Database database,
final SqlGeneratorChain sqlGeneratorChain) {
final String indexName = statement.getIndexName();
final Index example = new Index().setName(indexName);
if (statement.getTableName() != null) {
example.setTable((Table) new Table().setName(statement.getTableName()).setSchema(
statement.getTableCatalogName(), statement.getTableSchemaName()));
}
Index index;
try {
index = SnapshotGeneratorFactory.getInstance().createSnapshot(example, database);
} catch (final Exception e) {
throw new UnexpectedLiquibaseException("Failed to create a snapshot of '" + indexName
+ "'", e);
}
final String tableName = index.getTable().getName();
final Column column = index.getColumns().get(0);
final StringBuilder sql = new StringBuilder();
sql.append("DELETE FROM user_sdo_geom_metadata ");
sql.append("WHERE table_name = '").append(database.correctObjectName(tableName, Table.class));
sql.append("' AND column_name = '").append(
database.correctObjectName(column.getName(), Column.class));
sql.append("'");
final UnparsedSql deleteMetadata = new UnparsedSql(sql.toString(),
new View().setName("user_sdo_geom_metadata"));
return new Sql[] { deleteMetadata };
}
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:31,代码来源:DropSpatialIndexGeneratorOracle.java
示例12: generateDeleteMetadataSql
import liquibase.structure.core.Column; //导入依赖的package包/类
/**
* Generates the SQL for deleting any existing record from the
* <code>USER_SDO_GEOM_METADATA</code> table. Typically this record shouldn't be present but we
* must ensure that it does not already exist.
*
* @param statement
* the create spatial index statement.
* @param database
* the database instance.
* @return the SQL to delete any existing metadata record.
*/
protected String generateDeleteMetadataSql(final CreateSpatialIndexStatement statement,
final Database database) {
final StringBuilder sql = new StringBuilder();
sql.append("DELETE FROM user_sdo_geom_metadata ");
final String tableName = statement.getTableName().trim();
sql.append("WHERE table_name = '").append(database.correctObjectName(tableName, Table.class));
final String columnName = statement.getColumns()[0].trim();
sql.append("' AND column_name = '").append(
database.correctObjectName(columnName, Column.class));
sql.append("'");
return sql.toString();
}
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:24,代码来源:CreateSpatialIndexGeneratorOracle.java
示例13: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
/**
* @see liquibase.sqlgenerator.core.AddDefaultValueGenerator#generateSql(liquibase.statement.core.AddDefaultValueStatement, liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)
*/
@Override
public Sql[] generateSql(AddDefaultValueStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
Object defaultValue = statement.getDefaultValue();
LiquibaseDataType defaultValueType = DataTypeFactory.getInstance().fromObject(defaultValue, database);
return new Sql[]{
new UnparsedSql("ALTER TABLE " + database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName())
+ " ADD "
+ database.escapeColumnName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), statement.getColumnName())
+ " DEFAULT "
+ (defaultValueType instanceof DateTimeType ?" TIMESTAMP ":(defaultValueType instanceof DateType ?" DATE ":(defaultValueType instanceof TimeType ?" TIME ":"")))
+ defaultValueType.objectToSql(defaultValue, database),
new Column().setRelation(new Table().setName(statement.getTableName()).setSchema(new Schema(statement.getCatalogName(), statement.getSchemaName())).setName(statement.getColumnName())))
};
}
开发者ID:liquibase,项目名称:liquibase-teradata,代码行数:18,代码来源:AddDefaultValueGeneratorTeradata.java
示例14: getAffectedColumn
import liquibase.structure.core.Column; //导入依赖的package包/类
private Column getAffectedColumn(DropColumnStatement statement) {
return new Column().setName(statement.getColumnName()).setRelation(new Table().setName(statement.getTableName()).setSchema(statement.getCatalogName(), statement.getSchemaName()));
}
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:4,代码来源:HiveDropColumnGenerator.java
示例15: generateSql
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public Sql[] generateSql(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
String alterTable = "ALTER TABLE " + database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName()) +
" ADD " +
database.escapeColumnName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), statement.getColumnName())
+ " " + DataTypeFactory.getInstance().fromDescription(statement.getColumnType() + (statement.isAutoIncrement() ? "{autoIncrement:true}" : ""), database).toDatabaseDataType(database);
if (statement.isAutoIncrement() && database.supportsAutoIncrement()) {
alterTable += " " + database.getAutoIncrementClause(null, null);
}
if (!statement.isNullable()) {
alterTable += " NOT NULL";
} else {
if (database instanceof SybaseDatabase || database instanceof SybaseASADatabase) {
alterTable += " NULL";
}
}
if (statement.getDefaultValue()!=null){
alterTable += " DEFAULT ";
LiquibaseDataType defaultValueType = DataTypeFactory.getInstance().fromDescription(statement.getColumnType() + (statement.isAutoIncrement() ? "{autoIncrement:true}" : ""), database);
alterTable +=(defaultValueType instanceof DateTimeType ?" TIMESTAMP ":(defaultValueType instanceof DateType ?" DATE ":(defaultValueType instanceof TimeType ?" TIME ":"")));
alterTable += DataTypeFactory.getInstance().fromObject(statement.getDefaultValue(), database).objectToSql(statement.getDefaultValue(), database);
}
List<Sql> returnSql = new ArrayList<Sql>();
returnSql.add(new UnparsedSql(alterTable, new Column().setRelation(new Table().setName(statement.getTableName()).setSchema(new Schema(statement.getCatalogName(), statement.getSchemaName())).setName(statement.getColumnName()))));
if (statement.isPrimaryKey()) {
returnSql.addAll(Arrays.asList(SqlGeneratorFactory.getInstance().generateSql(new AddPrimaryKeyStatement(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), statement.getColumnName(), null) , database)));
}
if (statement.isUnique()) {
returnSql.addAll(Arrays.asList(SqlGeneratorFactory.getInstance().generateSql(new AddUniqueConstraintStatement(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), new ColumnConfig[] { new ColumnConfig().setName(statement.getColumnName())}, null) , database)));
}
// if (statement.getDefaultValue()!=null)
// returnSql.addAll(Arrays.asList(SqlGeneratorFactory.getInstance().generateSql(new AddDefaultValueStatement(statement.getSchemaName(), statement.getTableName(), statement.getColumnName(), statement.getColumnType(), statement.getDefaultValue()) , database)));
addForeignKeyStatements(statement, database, returnSql);
return returnSql.toArray(new Sql[returnSql.size()]);
}
开发者ID:liquibase,项目名称:liquibase-teradata,代码行数:44,代码来源:AddColumnGeneratorTeradata.java
示例16: run
import liquibase.structure.core.Column; //导入依赖的package包/类
@Override
public void run(Namespace namespace, Liquibase liquibase) throws Exception {
final Set<Class<? extends DatabaseObject>> compareTypes = new HashSet<>();
if (namespace.getBoolean("columns")) {
compareTypes.add(Column.class);
}
if (namespace.getBoolean("data")) {
compareTypes.add(Data.class);
}
if (namespace.getBoolean("foreign-keys")) {
compareTypes.add(ForeignKey.class);
}
if (namespace.getBoolean("indexes")) {
compareTypes.add(Index.class);
}
if (namespace.getBoolean("primary-keys")) {
compareTypes.add(PrimaryKey.class);
}
if (namespace.getBoolean("sequences")) {
compareTypes.add(Sequence.class);
}
if (namespace.getBoolean("tables")) {
compareTypes.add(Table.class);
}
if (namespace.getBoolean("unique-constraints")) {
compareTypes.add(UniqueConstraint.class);
}
if (namespace.getBoolean("views")) {
compareTypes.add(View.class);
}
final DiffResult diffResult = DiffGeneratorFactory.getInstance().compare(liquibase.getDatabase(), null,
new CompareControl(compareTypes));
final DiffToChangeLog diffToChangeLog = new DiffToChangeLog(diffResult, new DiffOutputControl());
final String filename = namespace.getString("output");
if (filename != null) {
try (PrintStream file = new PrintStream(filename, Charsets.UTF_8.name())) {
diffToChangeLog.print(file);
}
} else {
diffToChangeLog.print(System.out);
}
}
开发者ID:Astonish-Results,项目名称:dropwizard-routing,代码行数:46,代码来源:RoutingDbDumpCommand.java
注:本文中的liquibase.structure.core.Column类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论