Page 1 of 1
Migrations: Sequence and Trigger Names
Posted: Wed 07 Mar 2012 22:15
by ndroe
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?
Posted: Mon 12 Mar 2012 12:50
by Shalex
We will investigate the issue and post here about the results.
Posted: Tue 13 Mar 2012 15:18
by Shalex
- 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
An example for a usage of CreateTableConfiguration and DropTableConfiguration:
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"
});
We will post here when the corresponding build of dotConnect for Oracle is available for download.
Posted: Fri 23 Mar 2012 11:41
by Shalex
Current (6.80.325) build of dotConnect for Oracle includes the mentioned functionality. Please try it and notify us about the results.