SqlServerMigrationSqlGenerator.Generate SqlServerMigrationSqlGenerator.Generate SqlServerMigrationSqlGenerator.Generate Method

Definition

Overloads

Generate(IEnumerable<MigrationOperation>, String) Generate(IEnumerable<MigrationOperation>, String) Generate(IEnumerable<MigrationOperation>, String)

Converts a set of migration operations into Microsoft SQL Server specific SQL.

Generate(TimeSpan) Generate(TimeSpan) Generate(TimeSpan)

Generates SQL to specify a constant TimeSpan default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(String) Generate(String) Generate(String)

Generates SQL to specify a constant string default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(Object) Generate(Object) Generate(Object)

Generates SQL to specify a constant default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(Guid) Generate(Guid) Generate(Guid)

Generates SQL to specify a constant Guid default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(DateTimeOffset) Generate(DateTimeOffset) Generate(DateTimeOffset)

Generates SQL to specify a constant DateTimeOffset default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(DateTime) Generate(DateTime) Generate(DateTime)

Generates SQL to specify a constant DateTime default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(DbGeometry) Generate(DbGeometry) Generate(DbGeometry)

Generates SQL to specify a constant geometry default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(DbGeography) Generate(DbGeography) Generate(DbGeography)

Generates SQL to specify a constant geogrpahy default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(SqlOperation) Generate(SqlOperation)

Generates SQL for a SqlOperation. Generated SQL should be added using the Statement method.

Generate(RenameTableOperation) Generate(RenameTableOperation)

Generates SQL for a RenameTableOperation. Generated SQL should be added using the Statement method.

Generate(RenameColumnOperation) Generate(RenameColumnOperation)

Generates SQL for a RenameColumnOperation. Generated SQL should be added using the Statement method.

Generate(InsertHistoryOperation) Generate(InsertHistoryOperation)

Generates SQL for a InsertHistoryOperation. Generated SQL should be added using the Statement method.

Generate(MoveTableOperation) Generate(MoveTableOperation)

Generates SQL for a MoveTableOperation. Generated SQL should be added using the Statement method.

Generate(DropPrimaryKeyOperation) Generate(DropPrimaryKeyOperation)

Generates SQL for a DropPrimaryKeyOperation. Generated SQL should be added using the Statement method.

Generate(Boolean) Generate(Boolean) Generate(Boolean)

Generates SQL to specify a constant bool default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(Byte[]) Generate(Byte[]) Generate(Byte[])

Generates SQL to specify a constant byte[] default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

Generate(AddColumnOperation) Generate(AddColumnOperation)

Generates SQL for a AddColumnOperation. Generated SQL should be added using the Statement method.

Generate(DropTableOperation) Generate(DropTableOperation)

Generates SQL for a DropTableOperation. Generated SQL should be added using the Statement method.

Generate(AddPrimaryKeyOperation) Generate(AddPrimaryKeyOperation)

Generates SQL for a AddPrimaryKeyOperation. Generated SQL should be added using the Statement method.

Generate(AlterColumnOperation) Generate(AlterColumnOperation)

Generates SQL for a AlterColumnOperation. Generated SQL should be added using the Statement method.

Generate(AddForeignKeyOperation) Generate(AddForeignKeyOperation)

Generates SQL for a AddForeignKeyOperation. Generated SQL should be added using the Statement method.

Generate(CreateTableOperation) Generate(CreateTableOperation)

Generates SQL for a CreateTableOperation. Generated SQL should be added using the Statement method.

Generate(DeleteHistoryOperation) Generate(DeleteHistoryOperation)

Generates SQL for a DeleteHistoryOperation. Generated SQL should be added using the Statement method.

Generate(DropColumnOperation) Generate(DropColumnOperation)

Generates SQL for a DropColumnOperation. Generated SQL should be added using the Statement method.

Generate(DropForeignKeyOperation) Generate(DropForeignKeyOperation)

Generates SQL for a DropForeignKeyOperation. Generated SQL should be added using the Statement method.

Generate(DropIndexOperation) Generate(DropIndexOperation)

Generates SQL for a DropIndexOperation. Generated SQL should be added using the Statement method.

Generate(CreateIndexOperation) Generate(CreateIndexOperation)

Generates SQL for a CreateIndexOperation. Generated SQL should be added using the Statement method.

Generate(IEnumerable<MigrationOperation>, String) Generate(IEnumerable<MigrationOperation>, String) Generate(IEnumerable<MigrationOperation>, String)

Converts a set of migration operations into Microsoft SQL Server specific SQL.

public override System.Collections.Generic.IEnumerable<System.Data.Entity.Migrations.Sql.MigrationStatement> Generate (System.Collections.Generic.IEnumerable<System.Data.Entity.Migrations.Model.MigrationOperation> migrationOperations, string providerManifestToken);
override this.Generate : seq<System.Data.Entity.Migrations.Model.MigrationOperation> * string -> seq<System.Data.Entity.Migrations.Sql.MigrationStatement>
Public Overrides Function Generate (migrationOperations As IEnumerable(Of MigrationOperation), providerManifestToken As String) As IEnumerable(Of MigrationStatement)

Parameters

migrationOperations
IEnumerable<MigrationOperation>

The operations to be converted.

providerManifestToken
String String String

Token representing the version of SQL Server being targeted (i.e. "2005", "2008").

Returns

A list of SQL statements to be executed to perform the migration operations.

Generate(TimeSpan) Generate(TimeSpan) Generate(TimeSpan)

Generates SQL to specify a constant TimeSpan default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (TimeSpan defaultValue);
override this.Generate : TimeSpan -> string
Protected Overridable Function Generate (defaultValue As TimeSpan) As String

Parameters

defaultValue
TimeSpan TimeSpan TimeSpan

The value to be set.

Returns

SQL representing the default value.

Generate(String) Generate(String) Generate(String)

Generates SQL to specify a constant string default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (string defaultValue);
override this.Generate : string -> string
Protected Overridable Function Generate (defaultValue As String) As String

Parameters

defaultValue
String String String

The value to be set.

Returns

SQL representing the default value.

Generate(Object) Generate(Object) Generate(Object)

Generates SQL to specify a constant default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (object defaultValue);
override this.Generate : obj -> string
Protected Overridable Function Generate (defaultValue As Object) As String

Parameters

defaultValue
Object Object Object

The value to be set.

Returns

SQL representing the default value.

Generate(Guid) Generate(Guid) Generate(Guid)

Generates SQL to specify a constant Guid default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (Guid defaultValue);
override this.Generate : Guid -> string
Protected Overridable Function Generate (defaultValue As Guid) As String

Parameters

defaultValue
Guid Guid Guid

The value to be set.

Returns

SQL representing the default value.

Generate(DateTimeOffset) Generate(DateTimeOffset) Generate(DateTimeOffset)

Generates SQL to specify a constant DateTimeOffset default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (DateTimeOffset defaultValue);
override this.Generate : DateTimeOffset -> string
Protected Overridable Function Generate (defaultValue As DateTimeOffset) As String

Parameters

defaultValue
DateTimeOffset DateTimeOffset DateTimeOffset

The value to be set.

Returns

SQL representing the default value.

Generate(DateTime) Generate(DateTime) Generate(DateTime)

Generates SQL to specify a constant DateTime default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (DateTime defaultValue);
override this.Generate : DateTime -> string
Protected Overridable Function Generate (defaultValue As DateTime) As String

Parameters

defaultValue
DateTime DateTime DateTime

The value to be set.

Returns

SQL representing the default value.

Generate(DbGeometry) Generate(DbGeometry) Generate(DbGeometry)

Generates SQL to specify a constant geometry default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (System.Data.Spatial.DbGeometry defaultValue);
override this.Generate : System.Data.Spatial.DbGeometry -> string
Protected Overridable Function Generate (defaultValue As DbGeometry) As String

Parameters

defaultValue
DbGeometry DbGeometry DbGeometry

The value to be set.

Returns

SQL representing the default value.

Generate(DbGeography) Generate(DbGeography) Generate(DbGeography)

Generates SQL to specify a constant geogrpahy default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (System.Data.Spatial.DbGeography defaultValue);
override this.Generate : System.Data.Spatial.DbGeography -> string
Protected Overridable Function Generate (defaultValue As DbGeography) As String

Parameters

defaultValue
DbGeography DbGeography DbGeography

The value to be set.

Returns

SQL representing the default value.

Generate(SqlOperation) Generate(SqlOperation)

Generates SQL for a SqlOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.SqlOperation sqlOperation);
override this.Generate : System.Data.Entity.Migrations.Model.SqlOperation -> unit

Parameters

sqlOperation
SqlOperation SqlOperation SqlOperation

The operation to produce SQL for.

Generate(RenameTableOperation) Generate(RenameTableOperation)

Generates SQL for a RenameTableOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameTableOperation renameTableOperation);
override this.Generate : System.Data.Entity.Migrations.Model.RenameTableOperation -> unit

Parameters

renameTableOperation
RenameTableOperation RenameTableOperation RenameTableOperation

The operation to produce SQL for.

Generate(RenameColumnOperation) Generate(RenameColumnOperation)

Generates SQL for a RenameColumnOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameColumnOperation renameColumnOperation);
override this.Generate : System.Data.Entity.Migrations.Model.RenameColumnOperation -> unit

Parameters

renameColumnOperation
RenameColumnOperation RenameColumnOperation RenameColumnOperation

The operation to produce SQL for.

Generate(InsertHistoryOperation) Generate(InsertHistoryOperation)

Generates SQL for a InsertHistoryOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.InsertHistoryOperation insertHistoryOperation);
override this.Generate : System.Data.Entity.Migrations.Model.InsertHistoryOperation -> unit

Parameters

insertHistoryOperation
InsertHistoryOperation InsertHistoryOperation InsertHistoryOperation

The operation to produce SQL for.

Generate(MoveTableOperation) Generate(MoveTableOperation)

Generates SQL for a MoveTableOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.MoveTableOperation moveTableOperation);
override this.Generate : System.Data.Entity.Migrations.Model.MoveTableOperation -> unit

Parameters

moveTableOperation
MoveTableOperation MoveTableOperation MoveTableOperation

The operation to produce SQL for.

Generate(DropPrimaryKeyOperation) Generate(DropPrimaryKeyOperation)

Generates SQL for a DropPrimaryKeyOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation dropPrimaryKeyOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation -> unit

Parameters

dropPrimaryKeyOperation
DropPrimaryKeyOperation DropPrimaryKeyOperation DropPrimaryKeyOperation

The operation to produce SQL for.

Generate(Boolean) Generate(Boolean) Generate(Boolean)

Generates SQL to specify a constant bool default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (bool defaultValue);
override this.Generate : bool -> string
Protected Overridable Function Generate (defaultValue As Boolean) As String

Parameters

defaultValue
Boolean Boolean Boolean

The value to be set.

Returns

SQL representing the default value.

Generate(Byte[]) Generate(Byte[]) Generate(Byte[])

Generates SQL to specify a constant byte[] default value being set on a column. This method just generates the actual value, not the SQL to set the default value.

protected virtual string Generate (byte[] defaultValue);
override this.Generate : byte[] -> string
Protected Overridable Function Generate (defaultValue As Byte()) As String

Parameters

defaultValue
Byte[]

The value to be set.

Returns

SQL representing the default value.

Generate(AddColumnOperation) Generate(AddColumnOperation)

Generates SQL for a AddColumnOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddColumnOperation addColumnOperation);
override this.Generate : System.Data.Entity.Migrations.Model.AddColumnOperation -> unit

Parameters

addColumnOperation
AddColumnOperation AddColumnOperation AddColumnOperation

The operation to produce SQL for.

Generate(DropTableOperation) Generate(DropTableOperation)

Generates SQL for a DropTableOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropTableOperation dropTableOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DropTableOperation -> unit

Parameters

dropTableOperation
DropTableOperation DropTableOperation DropTableOperation

The operation to produce SQL for.

Generate(AddPrimaryKeyOperation) Generate(AddPrimaryKeyOperation)

Generates SQL for a AddPrimaryKeyOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation addPrimaryKeyOperation);
override this.Generate : System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation -> unit

Parameters

addPrimaryKeyOperation
AddPrimaryKeyOperation AddPrimaryKeyOperation AddPrimaryKeyOperation

The operation to produce SQL for.

Generate(AlterColumnOperation) Generate(AlterColumnOperation)

Generates SQL for a AlterColumnOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AlterColumnOperation alterColumnOperation);
override this.Generate : System.Data.Entity.Migrations.Model.AlterColumnOperation -> unit

Parameters

alterColumnOperation
AlterColumnOperation AlterColumnOperation AlterColumnOperation

The operation to produce SQL for.

Generate(AddForeignKeyOperation) Generate(AddForeignKeyOperation)

Generates SQL for a AddForeignKeyOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddForeignKeyOperation addForeignKeyOperation);
override this.Generate : System.Data.Entity.Migrations.Model.AddForeignKeyOperation -> unit

Parameters

addForeignKeyOperation
AddForeignKeyOperation AddForeignKeyOperation AddForeignKeyOperation

The operation to produce SQL for.

Generate(CreateTableOperation) Generate(CreateTableOperation)

Generates SQL for a CreateTableOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.CreateTableOperation createTableOperation);
override this.Generate : System.Data.Entity.Migrations.Model.CreateTableOperation -> unit

Parameters

createTableOperation
CreateTableOperation CreateTableOperation CreateTableOperation

The operation to produce SQL for.

Generate(DeleteHistoryOperation) Generate(DeleteHistoryOperation)

Generates SQL for a DeleteHistoryOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DeleteHistoryOperation deleteHistoryOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DeleteHistoryOperation -> unit

Parameters

deleteHistoryOperation
DeleteHistoryOperation DeleteHistoryOperation DeleteHistoryOperation

The operation to produce SQL for.

Generate(DropColumnOperation) Generate(DropColumnOperation)

Generates SQL for a DropColumnOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropColumnOperation dropColumnOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DropColumnOperation -> unit

Parameters

dropColumnOperation
DropColumnOperation DropColumnOperation DropColumnOperation

The operation to produce SQL for.

Generate(DropForeignKeyOperation) Generate(DropForeignKeyOperation)

Generates SQL for a DropForeignKeyOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropForeignKeyOperation dropForeignKeyOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DropForeignKeyOperation -> unit

Parameters

dropForeignKeyOperation
DropForeignKeyOperation DropForeignKeyOperation DropForeignKeyOperation

The operation to produce SQL for.

Generate(DropIndexOperation) Generate(DropIndexOperation)

Generates SQL for a DropIndexOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropIndexOperation dropIndexOperation);
override this.Generate : System.Data.Entity.Migrations.Model.DropIndexOperation -> unit

Parameters

dropIndexOperation
DropIndexOperation DropIndexOperation DropIndexOperation

The operation to produce SQL for.

Generate(CreateIndexOperation) Generate(CreateIndexOperation)

Generates SQL for a CreateIndexOperation. Generated SQL should be added using the Statement method.

protected virtual void Generate (System.Data.Entity.Migrations.Model.CreateIndexOperation createIndexOperation);
override this.Generate : System.Data.Entity.Migrations.Model.CreateIndexOperation -> unit

Parameters

createIndexOperation
CreateIndexOperation CreateIndexOperation CreateIndexOperation

The operation to produce SQL for.

Applies to