com.atlassian.confluence.upgrade.ddl
Class AlterColumnNullabilityCommand
java.lang.Object
com.atlassian.confluence.upgrade.ddl.AlterColumnCommand
com.atlassian.confluence.upgrade.ddl.AlterColumnNullabilityCommand
- All Implemented Interfaces:
- AlterTableCommand
public class AlterColumnNullabilityCommand
- extends AlterColumnCommand
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AlterColumnNullabilityCommand
public AlterColumnNullabilityCommand(ConfluenceHibernateConfig hibernateConfig,
java.lang.String columnName,
java.lang.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.
getCommandName
public java.lang.String getCommandName()
- 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 java.lang.String getCommandParameters()
- 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"
Copyright © 2003-2014 Atlassian. All Rights Reserved.