You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Directus 9.21.* When exporting the schema of a collection, the schema value is empty, which seems to cause relationships to fail. When I add the name of the collection to the schema value in the JSON, I can apply the schema without errors.
Hi @syoumans
I followed the guide in the documentation to set the schema field to an empty object when exporting.
So with "schema": {}, it should not cause any errors. I also tested on 9.21.0 and no bugs have been detected so far.
Without much context (i.e. where does the image field come from), I can't be sure about the root cause.
If it still troubles you, could you give me more info about your schema in a reproducible way?
Using Directus 9.21.* When exporting the schema of a collection, the schema value is empty, which seems to cause relationships to fail. When I add the name of the collection to the schema value in the JSON, I can apply the schema without errors.
Example Exported Collection
"collections": [ { "collection": "test_collection_2", "meta": { "collection": "test_collection_2", "icon": null, "note": null, "display_template": null, "hidden": false, "singleton": false, "translations": null, "archive_field": "status", "archive_app_filter": true, "archive_value": "archived", "unarchive_value": "draft", "sort_field": null, "accountability": "all", "color": null, "item_duplication_fields": null, "sort": 68, "group": null, "collapse": "open" }, "schema": {} } removed fields and relations ]
When I use the above with
npx directus schema apply ./file.json
I get the following error:After changing schema to be:
"schema": {"name": "test_collection_2"}
The apply works.
Maybe this is more of a Directus issue with the data coming out of the API? Thank you for considering this.
The text was updated successfully, but these errors were encountered: