-
Notifications
You must be signed in to change notification settings - Fork 4.4k
🐛 Bug Report: Multiple many to one relations in a database fail #6281
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
Comments
|
In one way - As we can see from the code that if these three thing matched we throw DuplicateException. So if type is relationship , collecitonId is same and relatedColleciton id is also same it will throw this DuplicateException, And in the case of Two way - twoWaykey contains the value of Attribute Key of related collection so if we put different Name of the attribute key of related collection we will not get the error. |
@stnguyen90 can i work on this issue? |
@hinnerkweiler, thanks for raising this issue! 🙏🏼 Let me talk to the team about this. |
This might also apply to one to one relationships. |
any update on this issue? |
yes @moshOntong-IT we are working on a fix for this issue 👍 |
@hinnerkweiler @moshOntong-IT |
How to set that? |
Create a new Relation Two-way relationship, Since it is not editable, and you will see Attribute Key (related collection) |
Im still getting the error... |
Thanks @rohankm |
Hey @stnguyen90 , I tried to create the following relationships combinations in the same document and between another document, and the second one is not going through. Let me know if you would like me to open a new issue with this one |
@DanielRiveraHQ, you can try again when 1.5.6 is released in the next week or so. |
Great, thank you @stnguyen90 |
@stnguyen90, just to report, it is working now; thank you again. |
👟 Reproduction steps
Create two Database collections and set a
many to one
or relation for a field from collectiona
tob
. Now repeat the step for a second field. The second relation can not be created.Tried this for
many to one
andmany to many
.Originally raised and discussed this issue on Discord and was asked to file a bug report: https://discord.com/channels/564160730845151244/1152869638431068220
in depth sample: I have a collection
Ports
holding a list of available ports to travel to and from. I also have a collectionReservations
where the user stores a travel plan. I need to referencePorts
-Document two times in eachReservation
, first for departure and than for destination. this seems to not be possible with the current relation management.👍 Expected behavior
Allow multiple references from one collection to another.
👎 Actual Behavior
The Reference is only set up once, more fields fail at creation.
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Linux
🧱 Your Environment
Tried in 1.4.2 and 1.4.3 plain install according docs
docker run...
on Ubuntu 22.04👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: