Method CreateForeignKey
- Namespace
- YndigoBlue.Velocity.Model
- Assembly
- YndigoBlue.Velocity.dll
CreateForeignKey(string, string, string, string, string, ForeignKeyRuleType, ForeignKeyRuleType)
Creates a foreign key constraint referencing a column in another table.
public ForeignKey CreateForeignKey(string name, string sourceColumn, string lookupSchema, string lookupTable, string lookupColumn, ForeignKeyRuleType deleteRule, ForeignKeyRuleType updateRule)
Parameters
namestringThe constraint name.
sourceColumnstringThe column in this table that holds the foreign key value.
lookupSchemastringThe schema containing the referenced table.
lookupTablestringThe name of the referenced table.
lookupColumnstringThe column in the referenced table.
deleteRuleForeignKeyRuleTypeThe rule applied to this row when the referenced row is deleted.
updateRuleForeignKeyRuleTypeThe rule applied to this row when the referenced key is updated.
Returns
- ForeignKey
The newly created ForeignKey.
CreateForeignKey(string, string[], string, string, string[], ForeignKeyRuleType, ForeignKeyRuleType)
Creates a composite foreign key constraint referencing columns in another table.
public ForeignKey CreateForeignKey(string name, string[] sourceColumns, string lookupSchema, string lookupTable, string[] lookupColumns, ForeignKeyRuleType deleteRule, ForeignKeyRuleType updateRule)
Parameters
namestringThe constraint name.
sourceColumnsstring[]The columns in this table that hold the foreign key values.
lookupSchemastringThe schema containing the referenced table.
lookupTablestringThe name of the referenced table.
lookupColumnsstring[]The columns in the referenced table.
deleteRuleForeignKeyRuleTypeThe rule applied when the referenced row is deleted.
updateRuleForeignKeyRuleTypeThe rule applied when the referenced key is updated.
Returns
- ForeignKey
The newly created ForeignKey.
CreateForeignKey(string, IEnumerable<string>, string, string, IEnumerable<string>, ForeignKeyRuleType, ForeignKeyRuleType)
Creates a composite foreign key constraint referencing columns in another table.
public ForeignKey CreateForeignKey(string name, IEnumerable<string> sourceColumns, string lookupSchema, string lookupTable, IEnumerable<string> lookupColumns, ForeignKeyRuleType deleteRule, ForeignKeyRuleType updateRule)
Parameters
namestringThe constraint name.
sourceColumnsIEnumerable<string>The columns in this table that hold the foreign key values.
lookupSchemastringThe schema containing the referenced table.
lookupTablestringThe name of the referenced table.
lookupColumnsIEnumerable<string>The columns in the referenced table.
deleteRuleForeignKeyRuleTypeThe rule applied when the referenced row is deleted.
updateRuleForeignKeyRuleTypeThe rule applied when the referenced key is updated.
Returns
- ForeignKey
The newly created ForeignKey.