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

Big directus_permissions export due to duplicates #22

Closed adelinn closed 5 months ago

adelinn commented 5 months ago

Describe the Bug

Export of directus_permissions sometimes gets really big due to many duplicates.

To Reproduce

To be determined. It happened to me on a fresh instance.

Version

1.6.2

Installed Extension Via

NPM Custom

u12206050 commented 5 months ago

The latest version if you use the following config will remove duplicates upon import.

    directus_permissions: {
        watch: ['permissions', 'collections', 'fields'],
        excludeFields: ['id'],
        getKey: (o) => `${o.role ?? 'public'}-${o.collection}--${o.action}`,
        query: {
            sort: ['role', 'collection', 'action'],
        },
    },