Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Relationship - unique index #5400

Open
2 tasks done
danilo73r opened this issue Apr 18, 2023 · 2 comments
Open
2 tasks done

🚀 Feature: Relationship - unique index #5400

danilo73r opened this issue Apr 18, 2023 · 2 comments
Labels
feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.

Comments

@danilo73r
Copy link

🔖 Feature description

Allow to include the id of a relationship (many to one for example) in a unique index.

🎤 Pitch

Useful for a lot of use cases.

For example: An order can't have same product in two lines, so i need unique index (product_id, order_id)

collection: order_line

  • attr: product_id (relationship)
  • attr: order_id (relationship)

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@joeyouss
Copy link

Hi, thank you for raising this. Opening it for the community to vote/leave their feedback on this as of now!

@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Apr 21, 2023
@pierroo
Copy link

pierroo commented Mar 13, 2024

Yes, very much needed!

Another example would be a chatting app, I wanna make sure I cannot create twice the same "conversation".
A 1:1 conversation having attributes "from_id" (my user id) and "friend_id" for example.

Instead of having to do first a query to make sure it doesn't exist yet, I would like the insert to be rejected by the database itself if the duo "from_id"/"friend_id" already exists

@stnguyen90 stnguyen90 added the feature / relationships Fixes and upgrades for database relationships label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

4 participants