Is it possible to configure the name of the sequence or trigger that is created by the CreateTable function?
Also, it seems odd that CreateTable adds a sequence and trigger, but DropTable doesn't remove them. Is this the expected behavior?
Migrations: Sequence and Trigger Names
- The possibility to specify the sequence and trigger names via CreateTableConfiguration and DropTableConfiguration classes in Code-First Migrations is implemented
- The bug with removing table's sequence when invoking DropTable in Code-First Migrations is fixed
Code: Select all
CreateTable("Blogs",
c => new {
BlogId = c.Int(nullable: false, identity: true),
Name = c.String(unicode: false),
},
anonymousArguments: new CreateTableConfiguration() {
IdentitySequenceName = "YOUR_SEQUENCE_NAME",
IdentityTriggerName = "YOUR_TRIGGER_NAME"
}
)
.PrimaryKey(t => t.BlogId);
DropTable("Blogs",
anonymousArguments: new DropTableConfiguration() {
IdentitySequenceName = "YOUR_SEQUENCE_NAME"
});