Autogeneration of datocms migrations only specific model(s)

:wave:, is there a way when using “autogeneration” between two environments only consider specific models?

Currently our approach is to make changes to a model in a sandbox environment, then run the autogeneration command of the cli, delete all unrelated changes from the migration file.

Sorry, I don’t think that’s currently an option in the script. Might be a nice feature request?

Also, just an idea – I haven’t tried this, so not sure if it’ll work – but maaaaaaaaaaybe you can create a special API key for the script that only allows it to “see” certain models? Roles and permissions — DatoCMS

I’m not sure if the script will error out if you do that, but maybe if it doesn’t have permission to see the model at all, it won’t try to diff it?

Unfortunately restricting the API to “see” only certain models has no effect.

I moved it to “Feature Requests”. Since this would be very useful I think, in our use case we have for example developed a private plugin to interactive with a certain Dato Model for sending Newsletter.

Our development process is that we develop changes/features/bugfixes in a sandbox environment first before moving to the the main one. These features etc… often involve a changes to the dato model therefore it would be very nice to create migration only for a specific model.

1 Like