Class MySqlDdl
java.lang.Object
io.ebeaninternal.dbmigration.ddlgeneration.platform.PlatformDdl
io.ebeaninternal.dbmigration.ddlgeneration.platform.MySqlDdl
- Direct Known Subclasses:
MariaDbDdl
MySql specific DDL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumnComment(DdlBuffer apply, String table, String column, String comment)Add column comment as a separate statement.voidaddTableComment(DdlBuffer apply, String tableName, String tableComment)Add table comment as a separate statement (from the create table statement).alterColumnBaseAttributes(AlterColumn alter)Alter column setting both the type and not null constraint.alterColumnDefaultValue(String tableName, String columnName, String defaultValue)Alter column setting the default value.alterColumnNotnull(String tableName, String columnName, boolean notnull)Alter a column adding or removing the not null constraint.alterColumnType(String tableName, String columnName, String type)Alter a column type.alterTableAddCheckConstraint(String tableName, String checkConstraintName, String checkConstraint)Alter table adding the check constraint.alterTableDropConstraint(String tableName, String constraintName)Drop a unique constraint from the table.alterTableDropForeignKey(String tableName, String fkName)Return the drop foreign key clause.createCheckConstraint(String ckName, String checkConstraint)Returns the check constraint.Return the drop index statement.voidinlineTableComment(DdlBuffer apply, String tableComment)Add an inline table comment to the create table statement.voidlockTables(DdlBuffer buffer, Collection<String> tables)Locks all tables for triggers that have to be updated.voidunlockTables(DdlBuffer buffer, Collection<String> tables)Unlocks all tables for triggers that have to be updated.Methods inherited from class io.ebeaninternal.dbmigration.ddlgeneration.platform.PlatformDdl
addHistoryTable, addTablePartition, alterTableAddColumn, alterTableAddForeignKey, alterTableAddUniqueConstraint, alterTableDropColumn, alterTableDropUniqueConstraint, asIdentityColumn, configure, convert, convertDefaultValue, createDdlHandler, createIndex, createSequence, createWithHistory, dropHistoryTable, dropIndex, dropSequence, dropTable, generateEpilog, generateProlog, getCreateTableCommandPrefix, getPlatform, getUpdateNullWithDefault, isIncludeStorageEngine, isInlineComments, isInlineForeignKeys, isInlineUniqueWhenNullable, regenerateHistoryTriggers, setLockTimeout, suppressPrimaryKeyOnPartition, tableInlineForeignKey, tableStorageEngine, useIdentityType, writeTableColumns
-
Constructor Details
-
MySqlDdl
-
-
Method Details
-
dropIndex
Return the drop index statement.- Overrides:
dropIndexin classPlatformDdl
-
alterTableDropForeignKey
Return the drop foreign key clause.- Overrides:
alterTableDropForeignKeyin classPlatformDdl
-
createCheckConstraint
Description copied from class:PlatformDdlReturns the check constraint.- Overrides:
createCheckConstraintin classPlatformDdl
-
alterTableAddCheckConstraint
public String alterTableAddCheckConstraint(String tableName, String checkConstraintName, String checkConstraint)Description copied from class:PlatformDdlAlter table adding the check constraint.- Overrides:
alterTableAddCheckConstraintin classPlatformDdl
-
alterTableDropConstraint
Description copied from class:PlatformDdlDrop a unique constraint from the table.- Overrides:
alterTableDropConstraintin classPlatformDdl
-
alterColumnType
Description copied from class:PlatformDdlAlter a column type.Note that that MySql and SQL Server instead use alterColumnBaseAttributes()
- Overrides:
alterColumnTypein classPlatformDdl
-
alterColumnNotnull
Description copied from class:PlatformDdlAlter a column adding or removing the not null constraint.Note that that MySql, SQL Server, and HANA instead use alterColumnBaseAttributes()
- Overrides:
alterColumnNotnullin classPlatformDdl
-
alterColumnDefaultValue
Description copied from class:PlatformDdlAlter column setting the default value.- Overrides:
alterColumnDefaultValuein classPlatformDdl
-
alterColumnBaseAttributes
Description copied from class:PlatformDdlAlter column setting both the type and not null constraint.Used by MySql, SQL Server, and HANA as these require both column attributes to be set together.
- Overrides:
alterColumnBaseAttributesin classPlatformDdl
-
inlineTableComment
Description copied from class:PlatformDdlAdd an inline table comment to the create table statement.- Overrides:
inlineTableCommentin classPlatformDdl- Throws:
IOException
-
addTableComment
public void addTableComment(DdlBuffer apply, String tableName, String tableComment) throws IOExceptionAdd table comment as a separate statement (from the create table statement).- Overrides:
addTableCommentin classPlatformDdl- Throws:
IOException
-
addColumnComment
Description copied from class:PlatformDdlAdd column comment as a separate statement.- Overrides:
addColumnCommentin classPlatformDdl
-
lockTables
Locks all tables for triggers that have to be updated.- Overrides:
lockTablesin classPlatformDdl- Throws:
IOException
-
unlockTables
Unlocks all tables for triggers that have to be updated.- Overrides:
unlockTablesin classPlatformDdl- Throws:
IOException
-