bcc-code / directus-schema-sync

The better way to sync your Directus schema and data between environments
Apache License 2.0
90 stars 4 forks source link

Initial admin role id issue #35

Closed Blaxzter closed 1 month ago

Blaxzter commented 3 months ago

Describe the Bug

I added directus-schema-sync to a local directus with docker once on my laptop and once in a new directus docker environment on my main pc. I used the same env parameter in both installs (both host systems are windows 11).

I set the env SCHEMA_SYNC: "BOTH" but there was no automatic schema sync in directus. After that I run docker-compose exec -it directus npx directus schema-sync import which run through and after a refresh in the browser I was greeted with "user doesn't has app access" which was the admin user.

image

This is the role diff after I killed the directus docker image / volumes, recreated the roles manually and exported again. Could it be the reason that a user has a role id assigned and overwriting these roles with a new one removes the association?

To Reproduce

Setup two directus instances. Export/Import from A to B and refresh.

(I have not verified that again 😅)

Version

1.6.4

Installed Extension Via

Docker file

u12206050 commented 1 month ago

Hmm, I see you are exporting the role id so it should be correctly synced and not be creating "duplicates". But since you say " recreated the roles manually " then that of course will create new roles with new ids, so you should rather be just importing your current configuration after starting up a fresh docker container in order to get the same roles with same id.