Class AlterColumnNullabilityCommand
java.lang.Object
com.atlassian.confluence.upgrade.ddl.AlterColumnNullabilityCommand
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionAlterColumnNullabilityCommand
(HibernateDatabaseCapabilities databaseCapabilities, String columnName, String oldDataType, NullChoice nullChoice) Create an alter column to null/not null action. -
Method Summary
-
Constructor Details
-
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 Details
-
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
- 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"
-