Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

'relations' uniqueness #598

Closed
lrkwz opened this issue Nov 19, 2018 · 6 comments
Closed

'relations' uniqueness #598

lrkwz opened this issue Nov 19, 2018 · 6 comments

Comments

@lrkwz
Copy link

lrkwz commented Nov 19, 2018

Feature Request

Add unique key to directus_relations(collection_many, field_many, collection_one, field_one, junction_field).

What problem does this feature solve?

  • Two users creating the same relation
  • Two identical rows inserted by repeated changes on data structure (create a relation then modify relation)

How do you think this should be implemented?

CREATE INDEX...

Would you be willing to work on this?

This is fairly easy, it's isn't that easy handle all the error condition that will arise from this change.

@benhaynes benhaynes added the enhancement New feature or request label Nov 19, 2018
@benhaynes benhaynes added this to To do in v2.0.9 via automation Nov 19, 2018
@benhaynes
Copy link
Sponsor Member

Thanks @lrkwz — we'll take a look at potentially adding this once @wellingguzman is back.

@lrkwz
Copy link
Author

lrkwz commented Nov 20, 2018

Probably #537 would benefit of this

@rijkvanzanten
Copy link
Member

I think #586 might potentially solve this as well

@lrkwz
Copy link
Author

lrkwz commented Nov 21, 2018

Still I suggest to enforce strong bonds directly in database for relations (unique indexes, foreign keys, ...) this will eventually let code errors immediately visible.

@stale
Copy link

stale bot commented Jan 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 20, 2019
@benhaynes
Copy link
Sponsor Member

To achieve better clarity/visibility, we are now tracking feature requests within the Feature Request project board.

This issue being closed does not mean it's not being considered.

@benhaynes benhaynes added this to Proposed in Feature Requests via automation May 20, 2019
samvasko pushed a commit to samvasko/api that referenced this issue Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request pinned
Projects
v2.0.10
  
To do
v2.0.11
  
To do
v2.0.9
  
To do
Development

No branches or pull requests

4 participants