Search in sources :

Example 1 with RenameTableStatement

use of liquibase.statement.core.RenameTableStatement in project liquibase by liquibase.

the class RenameTableChange method generateStatements.

@Override
public SqlStatement[] generateStatements(Database database) {
    List<SqlStatement> statements = new ArrayList<>();
    statements.add(new RenameTableStatement(getCatalogName(), getSchemaName(), getOldTableName(), getNewTableName()));
    if (database instanceof DB2Database) {
        statements.add(new ReorganizeTableStatement(getCatalogName(), getSchemaName(), getNewTableName()));
    }
    return statements.toArray(new SqlStatement[statements.size()]);
}
Also used : DB2Database(liquibase.database.core.DB2Database) SqlStatement(liquibase.statement.SqlStatement) ReorganizeTableStatement(liquibase.statement.core.ReorganizeTableStatement) ArrayList(java.util.ArrayList) RenameTableStatement(liquibase.statement.core.RenameTableStatement)

Aggregations

ArrayList (java.util.ArrayList)1 DB2Database (liquibase.database.core.DB2Database)1 SqlStatement (liquibase.statement.SqlStatement)1 RenameTableStatement (liquibase.statement.core.RenameTableStatement)1 ReorganizeTableStatement (liquibase.statement.core.ReorganizeTableStatement)1