A removed FK constraint automatically removes relationships

Posts   
 
    
Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 29-Sep-2014 07:21:31   

Hi guys

I am using LLBLGen 4.2 (runtime 4.2.14.811) with Sybase/SAP ASE 15.7

Previously there were 2 FK constraints, which I subsequently removed. I then did a db refresh + re-added the relationships within the LLBLGen designer manually and all seemed good.

However the next time I did a "refresh relational model from the database" due to other new fields, I got the message below... and the 2 manually-created relationships were deleted (and associated TypedLists got all confused):

Post-migration actions performed on entity model and other project elements Migration of relationships and unique constraints • The relationship 'ClientCharge.Booking - Booking.ClientCharge (m:1)' has been removed because its underlying foreign key constraint wasn't found in the refreshed relational model data. • The relationship 'ClientCharge.ShortBooking - ShortBooking.ClientCharges (m:1)' has been removed because its underlying foreign key constraint wasn't found in the refreshed relational model data.

Please let me know if you need anymore info.

Thanks, James

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Sep-2014 19:29:32   

You need to create a "Model Only relation". Otherwise, you'll need to set the following project setting to false.

Relationships follow db foreign key constraints When set to true (Default), all normal relationships which are not marked as 'model-only' have to have a foreign key constraint in the new relational model data after refresh, or they'll be removed. When set to true, new relationships are created from newly found foreign key constraints. When set to false, relationships without a foreign key constraint in the new relational model data are left as-is and there aren't any new relationships created from foreign key constraints found in the new relational model data. The value Default means the value in the preferences is used.

Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 30-Sep-2014 01:21:29   

Hi Walaa

Thank you!