com.atlassian.confluence.upgrade.ddl
Class AlterColumnNullabilityCommand

java.lang.Object
  extended by com.atlassian.confluence.upgrade.ddl.AlterColumnCommand
      extended by 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.


Constructor Summary
AlterColumnNullabilityCommand(ConfluenceHibernateConfig hibernateConfig, java.lang.String columnName, java.lang.String oldDataType, NullChoice nullChoice)
          Create an alter column to null/not null action.
 
Method Summary
 java.lang.String getCommandName()
           
 java.lang.String getCommandParameters()
           
 
Methods inherited from class com.atlassian.confluence.upgrade.ddl.AlterColumnCommand
getColumnName, getHibernateConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 alter
oldDataType - 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.
Method Detail

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.