Skip to content

Relationships for Auth (Users) and Storage (Buckets) #11304

@bfbechlin

Description

@bfbechlin

🔖 Enhancement description

Currently, Appwrite supports relationships between collections, but does not offer native relationship support for the Auth (Users) or Storage modules. To link a document to a specific user or a file, developers must use a String ID field and handle data integrity manually.

I am requesting the ability to define formal Relationships/Foreign Keys for:

  1. Users: Linking a document to a record in the Auth service.
  2. Storage: Linking a document to a specific file within a Bucket.

Proposed Solution

Extend the "Create Relationship" attribute menu to include two new system-level targets:

  • Target: User (Auth) – Automatically validates against existing User IDs.
  • Target: File (Storage) – Automatically validates against File IDs within a specified Bucket.

🎤 Pitch

  • Auth (Users): Beyond the document owner, many workflows require linking additional users. Example: A "Task" document where one user is the Creator (automatic), but another is linked via a relationship as the Reviewer or Assignee.
  • Storage: Ensuring that a "User Profile" document cannot reference a file ID that doesn't exist, or automatically identifying which files are "in use" by the database.

Current Workaround

Manually creating a String attribute to store the ID and performing manual lookups or client-side joins, which lacks referential integrity.

👀 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature / relationshipsFixes and upgrades for database relationshipsproduct / authFixes and upgrades for the Appwrite Auth / Users / Teams services.product / databasesFixes and upgrades for the Appwrite Database.product / messagingFixes and upgrades for the Appwrite Messaging.product / storageFixes and upgrades for the Appwrite Storage.sdk / cliFixes and upgrades for the Appwrite CLI.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions