C# Class Framework.Migrator.Fluent.ForeignKey

Provides fluent interface for foreign key building. Reference is the name of relationship. Names of primary key table and column, foreign key column is generated by comvention using reference name, but can be overrided.

By default: Primary key table Reference name in singular form. Primary key column Default primary key name - Id. Foreign key column Reference name in singular form + Id. Foreign key name FK_ + Foreign Key Table + _ + Reference name in singular form.
Inheritance: IMigrationPart, IColumn
ファイルを表示 Open project: coreframework/Core-Framework

Public Methods

Method Description
Column ( String columnName ) : ForeignKey

Changes the name of foreign key column.

ForeignKey ( String reference, String foreignKeyTable ) : System

Initializes a new instance of the ForeignKey class.

GetColumn ( ) : ECM7.Migrator.Framework.Column

Gets the column specification.

Migrate ( ITransformationProvider database ) : void

Implementation of this method is speicific to operation kind (add foreign key and remove foreign key).

Named ( String foreignKeyName ) : ForeignKey

Changes the name of DeleteConstraint.

NotRequired ( ) : ForeignKey

Makes foreign key column not required.

OnDelete ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey

Changes the DeleteConstraint behaviour for delete.

OnUpdate ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey

Changes the DeleteConstraint behaviour for delete.

PrimaryKey ( String columnName ) : ForeignKey

Changes the name of primary key column.

Table ( String tableName ) : ForeignKey

Changes the name of primary key table.

Type ( DbType foreignKeyColumnType ) : ForeignKey

Sets the data type of foreign key column.

WithoutColumn ( ) : ForeignKey

Avoids foreign key column adding or removing.

Method Details

Column() public method

Changes the name of foreign key column.
public Column ( String columnName ) : ForeignKey
columnName String Name of foreign key column.
return ForeignKey

ForeignKey() public method

Initializes a new instance of the ForeignKey class.
public ForeignKey ( String reference, String foreignKeyTable ) : System
reference String The reference.
foreignKeyTable String The foreign key table.
return System

GetColumn() public method

Gets the column specification.
public GetColumn ( ) : ECM7.Migrator.Framework.Column
return ECM7.Migrator.Framework.Column

Migrate() public method

Implementation of this method is speicific to operation kind (add foreign key and remove foreign key).
public Migrate ( ITransformationProvider database ) : void
database ITransformationProvider The database.
return void

Named() public method

Changes the name of DeleteConstraint.
public Named ( String foreignKeyName ) : ForeignKey
foreignKeyName String Name of DeleteConstraint.
return ForeignKey

NotRequired() public method

Makes foreign key column not required.
public NotRequired ( ) : ForeignKey
return ForeignKey

OnDelete() public method

Changes the DeleteConstraint behaviour for delete.
public OnDelete ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
return ForeignKey

OnUpdate() public method

Changes the DeleteConstraint behaviour for delete.
public OnUpdate ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
return ForeignKey

PrimaryKey() public method

Changes the name of primary key column.
public PrimaryKey ( String columnName ) : ForeignKey
columnName String Name of primary key column.
return ForeignKey

Table() public method

Changes the name of primary key table.
public Table ( String tableName ) : ForeignKey
tableName String Name of primary key table.
return ForeignKey

Type() public method

Sets the data type of foreign key column.
public Type ( DbType foreignKeyColumnType ) : ForeignKey
foreignKeyColumnType DbType Data type of foreign key column.
return ForeignKey

WithoutColumn() public method

Avoids foreign key column adding or removing.
public WithoutColumn ( ) : ForeignKey
return ForeignKey