atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

ref to a backref on a one to many realationship has to be non-unique #592

Open karina-klinkeviciute opened 2 months ago

karina-klinkeviciute commented 2 months ago

When linking a property with a ref to a property with backref, unique is being added to the property with ref, even when it's a one-to-many relationship, i.e. when backref property is an array. This shouldn't happen when the relationship is one-to-many. unique should only be on one-to-one relationships.

The code line for this is here: https://github.com/atviriduomenys/spinta/blob/392174aa73ea14acf1a2d3484563038b8db7058b/spinta/types/backref/link.py#L98

After fixing the issue, fix the tests too: https://github.com/atviriduomenys/spinta/blob/863e2b668235780e2f7264d847dc127ea06c7be2/tests/dtypes/test_backref.py#L89