NumericIdentityBehavior for DB2

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
ogi
Posts: 7
Joined: Wed 19 Oct 2016 07:19

NumericIdentityBehavior for DB2

Post by ogi » Mon 07 Aug 2017 07:56

Is there a way to set config.DatabaseScript.Column.NumericIdentityBehavior when using EF with dotConnect for DB2? I've seen it implemented in dotConnect for Oracle but I can't find it here.

Regards,
Andrej

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

Re: NumericIdentityBehavior for DB2

Post by Shalex » Mon 07 Aug 2017 13:35

Currenly this option is not implemented in dotConnect for DB2.

Could you please tell us how you want to change a default behavior with config.DatabaseScript.Column.NumericIdentityBehavior?

ogi
Posts: 7
Joined: Wed 19 Oct 2016 07:19

Re: NumericIdentityBehavior for DB2

Post by ogi » Tue 08 Aug 2017 05:43

I would like it to be GENERATED BY DEFAULT instead of GENERATED ALWAYS.

I think this would be the same as setting the Oracle config like so:

Code: Select all

config.DatabaseScript.Column.NumericIdentityBehavior = NumericIdentityBehavior.GeneratedByDefaultAsIdentity;
Edit:
The generated code first migration script now looks like this:

Code: Select all

CREATE TABLE Account ( 
  Id INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL)
The end result I hope to achieve is this:

Code: Select all

CREATE TABLE Account ( 
  Id INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL)

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

Re: NumericIdentityBehavior for DB2

Post by Shalex » Tue 08 Aug 2017 12:51

Thank you for the details. We will notify you when the option config.DatabaseScript.Column.NumericIdentityBehavior is implemented.

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

Re: NumericIdentityBehavior for DB2

Post by Shalex » Fri 08 Sep 2017 16:15

The new config.DatabaseScript.Column.NumericIdentityBehavior configuration option is implemented to manage a generation of columns with StoreGeneratedPattern="Identity": viewtopic.php?f=52&t=35925.

Post Reply