Class DropColumnSqlCommands
java.lang.Object
org.springframework.cloud.dataflow.common.flyway.SqlCommand
org.springframework.cloud.dataflow.server.db.migration.DropColumnSqlCommands
public class DropColumnSqlCommands
extends org.springframework.cloud.dataflow.common.flyway.SqlCommand
Utility class that can be used in future to drop columns.
This checks for the existence of the column before dropping.
- Author:
- Corneil du Plessis
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
dropColumn
(JdbcTemplate jdbcTemplate, Connection connection, String name) void
handle
(JdbcTemplate jdbcTemplate, Connection connection) protected boolean
hasColumn
(Connection connection, String schemaName, String tableName, String columnName) Methods inherited from class org.springframework.cloud.dataflow.common.flyway.SqlCommand
from, from, getCommand, getSuppressedErrorCodes
-
Constructor Details
-
DropColumnSqlCommands
-
-
Method Details
-
handle
- Overrides:
handle
in classorg.springframework.cloud.dataflow.common.flyway.SqlCommand
-
canHandleInJdbcTemplate
public boolean canHandleInJdbcTemplate()- Overrides:
canHandleInJdbcTemplate
in classorg.springframework.cloud.dataflow.common.flyway.SqlCommand
-
dropColumn
protected void dropColumn(JdbcTemplate jdbcTemplate, Connection connection, String name) throws SQLException - Throws:
SQLException
-
hasColumn
protected boolean hasColumn(Connection connection, String schemaName, String tableName, String columnName) throws SQLException - Throws:
SQLException
-