Class MySqlMigrationSqlGenerator
Implementation of a MySql's Sql generator for EF 4.3 data migrations.
Inheritance
Namespace: MySql.Data.EntityFramework
Assembly: MySql.Data.EntityFramework.dll
Version: 9.1.0
Syntax
public class MySqlMigrationSqlGenerator : MigrationSqlGenerator
Constructors
MySqlMigrationSqlGenerator()
Declaration
public MySqlMigrationSqlGenerator()
Methods
Generate(AddColumnOperation)
Generates a migration operation to add a column.
Declaration
protected virtual MigrationStatement Generate(AddColumnOperation op)
Parameters
Type | Name | Description |
---|---|---|
AddColumnOperation | op | The operation that represents a column being added to a table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to add a column. |
Generate(AddForeignKeyOperation)
Generates a migration operation to add a foreign key.
Declaration
protected virtual MigrationStatement Generate(AddForeignKeyOperation op)
Parameters
Type | Name | Description |
---|---|---|
AddForeignKeyOperation | op | the operation that represents a foreing key constraint being added to a table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to add a foreign key constraint. |
Generate(AddPrimaryKeyOperation)
Generates a migration operation to add a primary key to a table.
Declaration
protected virtual MigrationStatement Generate(AddPrimaryKeyOperation op)
Parameters
Type | Name | Description |
---|---|---|
AddPrimaryKeyOperation | op | The operation that represents adding a primary key to a table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to add a primary key to a table. |
Generate(AlterColumnOperation)
Generates a migration operation to alter a column.
Declaration
protected virtual MigrationStatement Generate(AlterColumnOperation op)
Parameters
Type | Name | Description |
---|---|---|
AlterColumnOperation | op | The operation that represents altering an existing column. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to alter a column. |
Generate(ColumnModel)
Generates an SQL statement of a column model.
Declaration
protected virtual string Generate(ColumnModel op)
Parameters
Type | Name | Description |
---|---|---|
ColumnModel | op | The model that represents a column. |
Returns
Type | Description |
---|---|
System.String | A string containing an SQL statement of a column model. |
Generate(CreateIndexOperation)
Generates a migration operation to create a database index.
Declaration
protected virtual MigrationStatement Generate(CreateIndexOperation op)
Parameters
Type | Name | Description |
---|---|---|
CreateIndexOperation | op | The operation that represents creating a database index. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to create a database index. |
Generate(CreateProcedureOperation)
Declaration
protected virtual MigrationStatement Generate(CreateProcedureOperation op)
Parameters
Type | Name | Description |
---|---|---|
CreateProcedureOperation | op |
Returns
Type | Description |
---|---|
MigrationStatement |
Generate(CreateTableOperation)
Generates a migration operation to create a table.
Declaration
protected virtual MigrationStatement Generate(CreateTableOperation op)
Parameters
Type | Name | Description |
---|---|---|
CreateTableOperation | op | The operation that represents creating a table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to create a table. |
Generate(DropColumnOperation)
Generates a migration operation to drop a column.
Declaration
protected virtual MigrationStatement Generate(DropColumnOperation op)
Parameters
Type | Name | Description |
---|---|---|
DropColumnOperation | op | The operation that represents a column being dropped from a table. |
Returns
Type | Description |
---|---|
MigrationStatement | The migration operation to drop a column. |
Generate(DropForeignKeyOperation)
Generates a migration operation to drop a foreign key constraint from a table.
Declaration
protected virtual MigrationStatement Generate(DropForeignKeyOperation op)
Parameters
Type | Name | Description |
---|---|---|
DropForeignKeyOperation | op | The operation that represents a foreign key being added from a table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to drop a foreign key. |
Generate(DropIndexOperation)
Generates a migration operation to drop an existing database index.
Declaration
protected virtual MigrationStatement Generate(DropIndexOperation op)
Parameters
Type | Name | Description |
---|---|---|
DropIndexOperation | op | The operation that represents dropping am existing database index. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to drop an existing database index. |
Generate(DropPrimaryKeyOperation)
Generates a migration operation to drpo an existing primary key.
Declaration
protected virtual MigrationStatement Generate(DropPrimaryKeyOperation op)
Parameters
Type | Name | Description |
---|---|---|
DropPrimaryKeyOperation | op | The operation that represents dropping an existing primary key. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to drop an existing primary key. |
Generate(DropTableOperation)
Generates a migration operation to drop an existing table.
Declaration
protected virtual MigrationStatement Generate(DropTableOperation op)
Parameters
Type | Name | Description |
---|---|---|
DropTableOperation | op | The operation that represents dropping an existing table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to drop an existing table. |
Generate(HistoryOperation)
Declaration
protected virtual MigrationStatement Generate(HistoryOperation op)
Parameters
Type | Name | Description |
---|---|---|
HistoryOperation | op |
Returns
Type | Description |
---|---|
MigrationStatement |
Generate(MoveTableOperation)
Not implemented yet.
Declaration
protected virtual MigrationStatement Generate(MoveTableOperation op)
Parameters
Type | Name | Description |
---|---|---|
MoveTableOperation | op | NA |
Returns
Type | Description |
---|---|
MigrationStatement | NA |
Generate(RenameColumnOperation)
Generates a migration operation to rename a column.
Declaration
protected virtual MigrationStatement Generate(RenameColumnOperation op)
Parameters
Type | Name | Description |
---|---|---|
RenameColumnOperation | op | The operation that represents a column being renamed. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to rename a column. |
Generate(RenameTableOperation)
Generates a migration operation to rename an existing table.
Declaration
protected virtual MigrationStatement Generate(RenameTableOperation op)
Parameters
Type | Name | Description |
---|---|---|
RenameTableOperation | op | The operation that represents renaming an existing table. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation to rename an existing table. |
Generate(SqlOperation)
Generates a migration operation with a MySQL statement to be executed.
Declaration
protected virtual MigrationStatement Generate(SqlOperation op)
Parameters
Type | Name | Description |
---|---|---|
SqlOperation | op | The operation representing a MySQL statement to be executed directly against the database. |
Returns
Type | Description |
---|---|
MigrationStatement | A migration operation with a MySQL statement to be executed. |
Generate(IEnumerable<MigrationOperation>, String)
Declaration
public override IEnumerable<MigrationStatement> Generate(IEnumerable<MigrationOperation> migrationOperations, string providerManifestToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<MigrationOperation> | migrationOperations | |
System.String | providerManifestToken |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MigrationStatement> |
GenerateProcedureBody(ICollection<DbModificationCommandTree>, String, String)
Declaration
public override string GenerateProcedureBody(ICollection<DbModificationCommandTree> commandTrees, string rowsAffectedParameter, string providerManifestToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<DbModificationCommandTree> | commandTrees | |
System.String | rowsAffectedParameter | |
System.String | providerManifestToken |
Returns
Type | Description |
---|---|
System.String |