v3.1 Designer - Manually added relationships removed on migrate from v2.6 to v3.1

Posts   
 
    
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 12-Jul-2011 01:34:46   

Hi.

I have entity SPBase inherited by entity SPWeb. SPBase has FK to self. I manually added relationship from SPWeb to SPWeb in v2.6 on this FK. It got removed on first catalog refresh in v3.1: The relationship 'SPEntityUserRoleAssignment.SPWeb - SPWeb. (m:1)' has been removed because its underlying foreign key constraint wasn't found in the refreshed relational model data

It looks like I now need to re-add all manual relationships. I will get started with that. I did not find anything about this issue when searching the support forum. Is it a known migration issue?

Thanks, Tore.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Jul-2011 03:23:16   

You have to set RelationshipsFollowDBForeignKeyConstraints to false in project properties before refresh the catalog. This is copied from the manual:

**RelationshipsFollowDBForeignKeyConstraints **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.

David Elizondo | LLBLGen Support Team
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 12-Jul-2011 03:59:52   

Thanks, I tried this from a fresh convert and it worked.

Isn't this a step back though? If I want any relationships without FK and lower the RelationshipsFollowDBForeignKeyConstraints flag to achieve this, I must now manually add new FK relationships that were earlier generated for me.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 12-Jul-2011 09:49:25   

Just mark these manual relations as Model-Only. Right click on the relation node in the Project Explorer. These should not be removed when refreshing the catalog with Relations-Following-Db.

hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 12-Jul-2011 15:28:39   

Thanks, that worked.

Best regards, Tore.