Class AlterColumnNullabilityCommand
- java.lang.Object
-
- com.atlassian.confluence.upgrade.ddl.AlterColumnNullabilityCommand
-
- All Implemented Interfaces:
AlterTableCommand
public class AlterColumnNullabilityCommand extends Object implements AlterTableCommand
Marks a column as not null or nullable. Make sure that the column being altered to NOT NULL is not used in an index on SQL Server. If it is, drop the index first, alter the column, and recreate the index.
-
-
Constructor Summary
Constructors Constructor Description AlterColumnNullabilityCommand(HibernateDatabaseCapabilities databaseCapabilities, String columnName, String oldDataType, NullChoice nullChoice)
Create an alter column to null/not null action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCommandName()
String
getCommandParameters()
-
-
-
Constructor Detail
-
AlterColumnNullabilityCommand
public AlterColumnNullabilityCommand(HibernateDatabaseCapabilities databaseCapabilities, String columnName, String oldDataType, NullChoice nullChoice)
Create an alter column to null/not null action.- Parameters:
columnName
- The name of the column to alteroldDataType
- The original data type of the column, required because some DBs don't let you only alter the null/not null property of the column. It is your responsibility to get this right.nullChoice
- Whether the column should be nullable or not null.- Since:
- 7.13.17
-
-
Method Detail
-
getCommandName
public String getCommandName()
- Specified by:
getCommandName
in interfaceAlterTableCommand
- Returns:
- The keyword/name of the current command for the current database (e.g. altering a column is "alter column" on PostgreSQL and "modify" on MySQL.
-
getCommandParameters
public String getCommandParameters()
- Specified by:
getCommandParameters
in interfaceAlterTableCommand
- Returns:
- The part that comes after the command name. E.g. "colname set not null" which would be after "alter column colname set not null"
-
-