Unique key in table is not picked up automatically 5.12.0

Posts   
 
    
morten71
User
Posts: 82
Joined: 13-Jan-2009
# Posted on: 03-May-2025 23:43:27   

After upgrading to 5.12, a unique key in an SQL server table is not picked up automatically using Pro Runtime Framework. (I'm pretty sure earlier versions did pick up and added unique keys to an entity's unique constraints.
/Morten

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39865
Joined: 17-Aug-2003
# Posted on: 04-May-2025 08:37:08   

morten71 wrote:

After upgrading to 5.12, a unique key in an SQL server table is not picked up automatically using Pro Runtime Framework. (I'm pretty sure earlier versions did pick up and added unique keys to an entity's unique constraints.
/Morten

Is it a unique index or a unique constraint? As the latter is obtained in the meta data but the former isn't. Nothing has changed in that area so it should do the same as in 5.11

Frans Bouma | Lead developer LLBLGen Pro
morten71
User
Posts: 82
Joined: 13-Jan-2009
# Posted on: 04-May-2025 09:52:13   

Otis wrote:

morten71 wrote:

After upgrading to 5.12, a unique key in an SQL server table is not picked up automatically using Pro Runtime Framework. (I'm pretty sure earlier versions did pick up and added unique keys to an entity's unique constraints.
/Morten

Is it a unique index or a unique constraint? As the latter is obtained in the meta data but the former isn't. Nothing has changed in that area so it should do the same as in 5.11

Hi Otis. It's a Type "Unique Key". I think the issue is that I put the Unique Key on a Foreign Key column. If I put a Unique Key on a non FK column, it's picked up by 5.12. I guess this is a limitation I was not aware of. I will work around it. /Morten

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39865
Joined: 17-Aug-2003
# Posted on: 05-May-2025 09:25:11   

morten71 wrote:

Otis wrote:

morten71 wrote:

After upgrading to 5.12, a unique key in an SQL server table is not picked up automatically using Pro Runtime Framework. (I'm pretty sure earlier versions did pick up and added unique keys to an entity's unique constraints.
/Morten

Is it a unique index or a unique constraint? As the latter is obtained in the meta data but the former isn't. Nothing has changed in that area so it should do the same as in 5.11

Hi Otis. It's a Type "Unique Key". I think the issue is that I put the Unique Key on a Foreign Key column. If I put a Unique Key on a non FK column, it's picked up by 5.12. I guess this is a limitation I was not aware of. I will work around it. /Morten

A unique constraint is picked up for an FK column (see the catalog meta data for the table) but if the column is an FK column, the relationship changes to a 1:1 relationship instead of a m:1, and therefore the UC isn't separately available in the entity. Maybe that's what you're seeing?

Frans Bouma | Lead developer LLBLGen Pro