Migrations: Sequence and Trigger Names

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
ndroe
Posts: 18
Joined: Fri 03 Feb 2012 16:08

Migrations: Sequence and Trigger Names

Post by ndroe » Wed 07 Mar 2012 22:15

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?

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 12 Mar 2012 12:50

We will investigate the issue and post here about the results.

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 13 Mar 2012 15:18

  • 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.

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 23 Mar 2012 11:41

Current (6.80.325) build of dotConnect for Oracle includes the mentioned functionality. Please try it and notify us about the results.

Post Reply