tractr / directus-sync

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

Extension deletes field if alias has the same name #116

Open Dominic-Marcelino opened 17 hours ago

Dominic-Marcelino commented 17 hours ago

Describe the bug In case an alias (e.g a group) has the same name/key as a field, one of them is missed in the sync and the other one deleted on push without any notification.

To Reproduce

  1. Create a group Content and a field content (haven't tested if the casing actually makes a difference)
  2. Run directus-sync pull
  3. Open JSON file snapshots/fields/<collection_name>/content.json
  4. Only the actual field OR the alias are tracked
  5. Run directus-sync push and the untracked one (field or alias) is deleted

Expected behavior As directus aliasses aren't real database fields, both can have the same name / key. Not sure how the extension could handle this, but maybe alias fields could get a prefix in the filename.

Versions (please complete the following information):