public class HibernateAlterTableExecutor extends Object implements AlterTableExecutor
PLEASE READ: Due to CONFDEV-7957 (and until HSQLDB addresses their concurrency issues), any upgrade tasks that composes this executor must be wrapped in a transaction proxy with REQUIRES_NEW propagation.
Modifier and Type | Field and Description |
---|---|
static int |
HSQLDB_RELATION_ALREADY_EXISTS_ERRORCODE |
static String |
HSQLDB_RELATION_ALREADY_EXISTS_SQLSTATE |
static int |
MYSQL_RELATION_ALREADY_EXISTS_ERRORCODE |
static String |
MYSQL_RELATION_ALREADY_EXISTS_SQLSTATE |
static String |
POSTGRES_RELATION_ALREADY_EXISTS_SQLSTATE |
static int |
SQLSERVER_INDEX_ALREADY_EXISTS_ERRORCODE |
static int |
SQLSERVER_RELATION_ALREADY_EXISTS_ERRORCODE |
Constructor and Description |
---|
HibernateAlterTableExecutor(ConfluenceHibernateConfig hibernateConfig,
DdlExecutor ddlExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
alterTable(String tableName,
List<? extends AlterTableCommand> commands)
Perform a set of table altering actions on a given table.
|
AddUniqueConstraintCommand |
createAddUniqueConstraintCommand(String constraintName,
String... columnNames) |
AlterColumnNullabilityCommand |
createAlterColumnNullChoiceCommand(String columnName,
String oldDataType,
NullChoice nullChoice) |
DropUniqueConstraintByColumnsCommand |
createDropUniqueConstraintByColumnsCommand(String... columnNames)
Drop constraints by column names.
|
DropUniqueConstraintCommand |
createDropUniqueConstraintCommand(String constraintName) |
List<String> |
getAlterTableStatements(String tableName,
List<? extends AlterTableCommand> commands) |
public static final String POSTGRES_RELATION_ALREADY_EXISTS_SQLSTATE
public static final String MYSQL_RELATION_ALREADY_EXISTS_SQLSTATE
public static final int MYSQL_RELATION_ALREADY_EXISTS_ERRORCODE
public static final int SQLSERVER_INDEX_ALREADY_EXISTS_ERRORCODE
public static final int SQLSERVER_RELATION_ALREADY_EXISTS_ERRORCODE
public static final String HSQLDB_RELATION_ALREADY_EXISTS_SQLSTATE
public static final int HSQLDB_RELATION_ALREADY_EXISTS_ERRORCODE
public HibernateAlterTableExecutor(ConfluenceHibernateConfig hibernateConfig, DdlExecutor ddlExecutor)
public AlterColumnNullabilityCommand createAlterColumnNullChoiceCommand(String columnName, String oldDataType, NullChoice nullChoice)
createAlterColumnNullChoiceCommand
in interface AlterTableExecutor
public AddUniqueConstraintCommand createAddUniqueConstraintCommand(String constraintName, String... columnNames)
createAddUniqueConstraintCommand
in interface AlterTableExecutor
public DropUniqueConstraintCommand createDropUniqueConstraintCommand(String constraintName)
createDropUniqueConstraintCommand
in interface AlterTableExecutor
public DropUniqueConstraintByColumnsCommand createDropUniqueConstraintByColumnsCommand(String... columnNames)
AlterTableExecutor
createDropUniqueConstraintByColumnsCommand
in interface AlterTableExecutor
columnNames
- The names of the columns that make up the unique constraintpublic void alterTable(String tableName, List<? extends AlterTableCommand> commands)
AlterTableExecutor
alterTable
in interface AlterTableExecutor
tableName
- Name of the table to altercommands
- A collection of alter table actions to performpublic List<String> getAlterTableStatements(String tableName, List<? extends AlterTableCommand> commands)
getAlterTableStatements
in interface AlterTableExecutor
Copyright © 2003–2017 Atlassian. All rights reserved.