Back

Relationship error in collections

  • 0
  • Self Hosted
  • Databases
Maxim
16 May, 2024, 18:13

There is a question about relationships in collections.

  1. I create the "authorId" attribute in the project table and link it to the user table - ok.
  2. I create the second necessary attribute "inspectorId" by analogy, but I get the error "Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key"

What I expect is that a project can have one author and one inspector, a user can be an author in many projects, the same user can be an inspector in many projects as well

I found information that this is an interface problem and tried through the CLI, but there is exactly the same error. Who can tell me what I'm doing wrong?

TL;DR
Issue with creating relationships in collections - error "Attribute with the requested key already exists" when creating "inspectorId" attribute. Want each project to have one author and one inspector, with users able to be author/inspector in multiple projects. This is likely an interface problem. Solution: Try using a different key for the "inspectorId" attribute.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more