tractr / directus-sync

A CLI tool for synchronizing the schema and configuration of Directus across various environments.
GNU General Public License v3.0
209 stars 8 forks source link

Error When Syncing New Folders Between Environments: "Value for field 'id' in collection 'directus_folders' has to be unique." #92

Open Vahagn-Zaqaryan opened 1 month ago

Vahagn-Zaqaryan commented 1 month ago

Describe the Bug

I maintain both production and testing environments, and our content writers recently organized our media files into folders. When I first attempted to sync these folders between environments, everything worked smoothly. However, after they created a few additional folders, I encountered an error: Value for field "id" in collection "directus_folders" has to be unique.

To Reproduce

Steps to reproduce the issue:

  1. Set up two empty Directus instances.
  2. Create a folder in one of the instances.
  3. Sync the folder to the other instance.
  4. Create another folder.
  5. Attempt to sync the second folder, and you should encounter the following error:
ERROR (1918487):
    errors: [
      {
        "message": "Value for field \"id\" in collection \"directus_folders\" has to be unique.",
        "extensions": {
          "collection": "directus_folders",
          "field": "id",
          "code": "RECORD_NOT_UNIQUE"
        }
      }
    ]
    response: {}

Expected Behavior

The synchronization should complete without any issues.

Versions

Additional Context

First, I want to express my gratitude for creating and maintaining this repository. It has saved us months of work, and I'm eager to assist in making it even better! 🚀

If you need any further information, please don't hesitate to ask.