Class CreateForeignKeyExpression
Represents an expression used to define a foreign key constraint as part of a database migration. This expression specifies the relationship between tables by linking columns in the source and target tables.
Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions.Common.Expressions
Assembly: Umbraco.Infrastructure.dll
Syntax
public class CreateForeignKeyExpression : MigrationExpressionBase, IMigrationExpression
Constructors
View SourceCreateForeignKeyExpression(IMigrationContext)
Initializes a new instance of the CreateForeignKeyExpression class using the specified migration context.
Declaration
public CreateForeignKeyExpression(IMigrationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationContext | context | The IMigrationContext to be used for the migration operation. |
CreateForeignKeyExpression(IMigrationContext, ForeignKeyDefinition)
Initializes a new instance of the CreateForeignKeyExpression class with the specified migration context and foreign key definition.
Declaration
public CreateForeignKeyExpression(IMigrationContext context, ForeignKeyDefinition fkDef)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationContext | context | The IMigrationContext to use for the migration. |
| ForeignKeyDefinition | fkDef | The ForeignKeyDefinition that defines the foreign key. |
Properties
View SourceForeignKey
Gets or sets the ForeignKeyDefinition representing the foreign key associated with this expression.
Declaration
public ForeignKeyDefinition ForeignKey { get; set; }
Property Value
| Type | Description |
|---|---|
| ForeignKeyDefinition |
Methods
View SourceGetSql()
Declaration
protected override string GetSql()
Returns
| Type | Description |
|---|---|
| string |