There is no official way today to run migrations in Directus in a way to support automation between environments. The only way to do that is to create migrations using knex manually. Doing so however has a few drawbacks:
Given the above problem, here is the formula that this package implements to try to solve:
npx directus-auto-migrate my-first-migration
Optional arguments:
The solution is experimental and only tested with Postgres. Please always inspect the generated queries and verify that they correspond to the real changes being done.
It is recommended that after the migration is generated, you reset your database with that migration to ensure that the Directus app works as expected.
It is recommended to use Docker for easier database start and restart and to leverage the Directus migrations system
$ claude mcp add directus-auto-migrate \
-- python -m otcore.mcp_server <graph>