IsIdentity field setup in model

Posts   
 
    
cerberis
User
Posts: 93
Joined: 20-May-2011
# Posted on: 22-May-2014 08:46:08   

Hello,

I got quite small problem with DDL Script generation when using Model first scenario. It seems that in some cases field is not marked as IsIdentity. For example we have column Id, which is not primary key in the model. However we set sequence for this field. But field is not always marked as IsIdentity. Any ideas on this? What are the rules?

LLBLGen 4.1 - Latest (yesterdays release, 2014 May 22)

regards Mantas

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-May-2014 09:29:55   

You have an example of such field? (field type, mapping target etc.) Otherwise it's a long search for us when it exactly occurs...

Frans Bouma | Lead developer LLBLGen Pro
cerberis
User
Posts: 93
Joined: 20-May-2011
# Posted on: 22-May-2014 12:26:51   

I just create new model, add field Id with type Int. It can be also more columns. Then got to field mappings, press Create Mappings, than New target. Fields are mapped. Then I select Id field and set Sequence on it. We are using MySQL driver.

cerberis
User
Posts: 93
Joined: 20-May-2011
# Posted on: 22-May-2014 12:40:38   

It seems that there is similar problem with Primary key field. I see in mappings that field is marked as PK. But target db field does not have IsPrimary flag.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-May-2014 12:56:47   

You have to click 'Validate and adjust relational model data' to finalize pk / fk etc. settings onto the relational model. The reason is that multiple changes on the model might be needed to 1 change so not all changes on the entity model are directly resulting in a change on the relational model. If you do the above, do you see the changes?

Frans Bouma | Lead developer LLBLGen Pro
cerberis
User
Posts: 93
Joined: 20-May-2011
# Posted on: 22-May-2014 13:08:15   

Validate and adjust helped. Thank you very much.