Page 1 of 1
NumericIdentityBehavior for DB2
Posted: Mon 07 Aug 2017 07:56
by ogi
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
Re: NumericIdentityBehavior for DB2
Posted: Mon 07 Aug 2017 13:35
by Shalex
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?
Re: NumericIdentityBehavior for DB2
Posted: Tue 08 Aug 2017 05:43
by ogi
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)
Re: NumericIdentityBehavior for DB2
Posted: Tue 08 Aug 2017 12:51
by Shalex
Thank you for the details. We will notify you when the option config.DatabaseScript.Column.NumericIdentityBehavior is implemented.
Re: NumericIdentityBehavior for DB2
Posted: Fri 08 Sep 2017 16:15
by Shalex
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.