In a FluentMigrator migration, if I'm defining a relationship, say:
Create.Table("RelatedTable")
.WithColumn("RelatedTableId").AsGuid().PrimaryKey()
.WithColumn("MainTableId").AsGuid().NotNullable();
.WithColumn("SomeInfo").AsString().NotNullable();
Create.Table("MainTable")
.WithColumn("MainTableId").AsGuid().PrimaryKey()
.ReferencedBy("FK_RelatedTable_RelatedTableId", "RelatedTable", "MainTableId")
.WithColumn("AField").AsInt64().NotNullable()
.WithColumn("AnotherField").AsString().NotNullable();
Is there any way to define cascading delete type of relationship between them? Eg, if you delete something from MainTable, any related records are also deleted?
ForeignKey("abc", "dfg").OnDeleteOrUpdate(System.Data.Rule.Cascade)
– Gushy