SqlServerMigrationSqlGenerator.Generate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Generate(IEnumerable<MigrationOperation>, String) |
Converts a set of migration operations into Microsoft SQL Server specific SQL. |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
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) |
Generates SQL for a SqlOperation. Generated SQL should be added using the Statement method. |
Generate(RenameTableOperation) |
Generates SQL for a RenameTableOperation. Generated SQL should be added using the Statement method. |
Generate(RenameColumnOperation) |
Generates SQL for a RenameColumnOperation. Generated SQL should be added using the Statement method. |
Generate(InsertHistoryOperation) |
Generates SQL for a InsertHistoryOperation. Generated SQL should be added using the Statement method. |
Generate(MoveTableOperation) |
Generates SQL for a MoveTableOperation. Generated SQL should be added using the Statement method. |
Generate(DropPrimaryKeyOperation) |
Generates SQL for a DropPrimaryKeyOperation. Generated SQL should be added using the Statement method. |
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[]) |
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) |
Generates SQL for a AddColumnOperation. Generated SQL should be added using the Statement method. |
Generate(DropTableOperation) |
Generates SQL for a DropTableOperation. Generated SQL should be added using the Statement method. |
Generate(AddPrimaryKeyOperation) |
Generates SQL for a AddPrimaryKeyOperation. Generated SQL should be added using the Statement method. |
Generate(AlterColumnOperation) |
Generates SQL for a AlterColumnOperation. Generated SQL should be added using the Statement method. |
Generate(AddForeignKeyOperation) |
Generates SQL for a AddForeignKeyOperation. Generated SQL should be added using the Statement method. |
Generate(CreateTableOperation) |
Generates SQL for a CreateTableOperation. Generated SQL should be added using the Statement method. |
Generate(DeleteHistoryOperation) |
Generates SQL for a DeleteHistoryOperation. Generated SQL should be added using the Statement method. |
Generate(DropColumnOperation) |
Generates SQL for a DropColumnOperation. Generated SQL should be added using the Statement method. |
Generate(DropForeignKeyOperation) |
Generates SQL for a DropForeignKeyOperation. Generated SQL should be added using the Statement method. |
Generate(DropIndexOperation) |
Generates SQL for a DropIndexOperation. Generated SQL should be added using the Statement method. |
Generate(CreateIndexOperation) |
Generates SQL for a CreateIndexOperation. Generated SQL should be added using the Statement method. |
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
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.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The value to be set.
Returns
SQL representing the default value.
Applies to
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.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
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
The operation to produce SQL for.
Applies to
Entity Framework