tractr / directus-sync Goto Github PK
View Code? Open in Web Editor NEWA CLI tool for synchronizing the schema and configuration of Directus across various environments.
License: Other
A CLI tool for synchronizing the schema and configuration of Directus across various environments.
License: Other
Hi, was trying to migrate directus from sqlite to mysql. But I'm facing issues doing that with directus sync. Is there a better way to proceed ?
Directus: V10.8.3
Self hosted
The extension creates a collection starting with "directus_".
Those collections are checked by directus system itself and they cant be deleted by the front-end admin panel.
The action will also prevent to use endpoint https://docs.directus.io/reference/system/schema.html#apply-schema-difference
use a different name convention in the extension that it does not conflict with "directus_"
Of note: currently running Directus v10.2.1
When a flow includes the "Trigger Flow" operation, the flow UUID that it triggers is stored in the "options" field and is not updated causing the flow to become broken.
Example trigger flow in the operations.json
file:
{
"name": "Trigger Flow",
"key": "trigger_y2due",
"type": "trigger",
"position_x": 48,
"position_y": 48,
"options": {
"flow": "14714bf5-5645-4995-9d2b-8357b98b232d",
"payload": {
"data": "{{ $last[0] }}"
},
"iterationMode": "serial"
},
"resolve": null,
"reject": null,
"flow": "b9920111-288b-4200-8b0a-e480ebea19e7",
"_syncId": "475769af-6e10-48a9-8e2e-83cc625e8686"
},
I may not fully understand how the linking is working in directus-sync but that 14714bf5 flow ID is also the _syncId of the first operation in the flow that is triggered as well as the (as expected) "operation" field in the triggered flow in the flows.json file.
Per this, it seems like maybe the trigger flow operations are just not getting updated with the newly created triggered flow UUID after creation?
Happy to submit a PR after a bit more understanding of how this linking is working. Would there just need to be a check for flow being a key under options before this idMappers object and then updating it beforehand?
Hi,
We are using self hosted Directus:
Directus version: 10.8.3
Self hosted:
To replicate the error run Directus in a self-hosted with a self-signed certificate using HTTPS.
The call "pull" : npx directus-sync pull --config-path './directus-sync.config.cjs'
The device is in our intranet.. We got our own domain server, so we put the domain directly in the config.
This is our config
Thanks in advance :)
Hi I am running a Directus app with Docker,
I have a local file directus-sync.config.cjs
mounted as a volume to the docker container /directus/directus-sync.config.cjs .
With this setup and on [email protected], directus-sync was doing a great job.
After upgrading to [email protected], I ran diff
to see if any changes in schema with --force
and DEBUG
on.
The directus-sync diff log shows a list of [permissions] Will remove dangling id map
.
If I do a push
and run diff
again, these messages still persist.
At this point, any changes made on directus access control is not recognised by directus-sync.
Wonder if there are any proper steps required for handling Directus upgrade?
Tested on a fresh directus docker container.
Hello,
I don't know if I am just too bad to use the tool but I cannot manage to synchronize Directus custom collections and so on that are named in directus-sync snapshot and are exported in snapshot folder.
Environment:
Directus: 10.9.3
directus-extension-sync (on Directus Servers): 0.4.0
directus-sync (on client CLI): 1.0.0 ? npx directus-sync -V => unknown
What I do:
I always got for diff and push commands:
INFO (110897): [snapshot] No changes to apply
For the collections which are exported in collections folder everything is working fine.
I even tried with the --no-split option in case there was a parser bug, but I always got a "no changes to apply" message and my custom collection are not created / updated on the target Directus instance.
Is it a problem with how I use it? Am I not using the right versions?
Can we copy collections schema and data to a different env?
Thanks for this plugin! I'm trying to set it up so that I can add the data to my repository. What I've tried to do is share a folder with the docker container, and add the config to that folder, but I'm getting Missing option directusEmail
, is my approach wrong?
Added directus-sync folder to my volumes
directus:
build:
context: ./
restart: unless-stopped
ports:
- "8055:8055"
volumes:
- ./directus-sync:/directus-sync
- ./uploads:/directus/uploads
- ./extensions:/directus/extensions
Inside the directus-sync folder is the directus-sync.config.js file
I'm running the command inside my docker container using docker exec -ti directus-docker-directus-1 npx directus-sync diff -c ./directus-sync/directus-sync.config.js
Thanks!
It would be nice to have an option to sync actual data.
For example for API keys or data that always needs to be the same across deployments.
The other suggestion i have is to add default data.
This could come in handy in an ecommerce system with VAT rules or shipping options.
The only thing to watch out is relations, you cannot assume that every system has the same ids or relations.
Any suggestions on an easy way to null out specific fields via configuration?
Specifically looking at:
"project_logo": null,
"public_foreground": null,
"public_background": null,
in the settings.json
collection file which were in my case set to UUIDs from the media library. Or are you considering situations like this with the custom data backup you mentioned in Discord? Thanks for such a great tool!
The extension installation manual disappeared after the last release.
Steps to reproduce:
Expected is manual for installation
I'm trying to push my schema, that I've just pulled, and my server seems to freeze up. I've tried pushes before with other schemas, and it takes a few seconds for info to start showing in the console, however with this schema there's never info in the console and my CPU stays at 100%
I'm using docker, with this command docker exec -ti directus-docker-directus-1 npx directus-sync push
docker exec -ti directus-docker-directus-1 npx directus-sync diff
the same thing happens-d
flag, nothing changes, the server freezes before any output is seenAny idea how I can debug this? Thanks
Any thoughts on adding bookmarks/presets as a synced collection? I realize this may be better as a manually enabled collection rather than a default one since the collection can grow quickly but with the help of the onQuery hook filter, I'm hoping to pull out all globally set presets that get applied to a fresh Directus instance and keep them with the schema syncing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.