Identity fields not being created with refresh of data

Posts   
 
    
Posts: 18
Joined: 06-Dec-2012
# Posted on: 18-Jul-2013 14:45:59   

I did a refresh of my relational model data but the new tables that were created in the oracle database does not have their primary keys. Then I try to refresh the relational model data I get a message about creating a DDL script. What is causing all these issues? Thank you.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Jul-2013 20:34:25   

You were too short in words simple_smile I assume you have defined the PKs in the Designer, correct?

Then you can safely ignore the Update DDL script, which is attempting to update your DB schema to create these PKs you have identified in the Designer.

Also you can set the following project property to false.

Identifying fields follow db primary key constraints When set to true (Default), all identifying fields in entities have to have a target field which is also a primary key in the new relational model data after refresh, or they'll be cleared from being identifying fields. When set to false, identifying fields without a primary key field as target in the new relational model data are left as-is and there aren't any fields marked as identifying fields based on primary key fields found in the new relational model data. The value Default means the value in the preferences is used.

Posts: 18
Joined: 06-Dec-2012
# Posted on: 18-Jul-2013 20:51:41   

All my tables in the catalog explorer except for my new ones have their primary keys associated with them. Why wouldn't my new tables have their primary keys brought over as well? I have to manually in the project explorer and add the identity fields every time my DB changes something in the database.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Jul-2013 04:21:34   

Your old tables have valid PKs in your DB, And your new ones don't, Right? If that is so, don't change anything in the catalog explorer, as doing that will be detected as a change in your DB (your catalog explorer is a representation of the info in your DB), and you will be prompted to generate an Update Script to put in sync your DB. With your old tables there is no problem as they have the PK info in the DB, thus in the catalog explorer as well.

Instead, modify your model, edit the entity and set the IdentifyingFields manually, then set the flag that Walaa mentioned to 'false', that way the model's PKs will be kept as is during refreshes.

David Elizondo | LLBLGen Support Team