datocms / cli

Official CLI to interact with DatoCMS projects!
MIT License
7 stars 7 forks source link

Migration autogeneration fails if the source environment is empty #15

Closed illarionvk closed 1 year ago

illarionvk commented 1 year ago

The autogenerate command fails with a TypeError: Cannot read properties of undefined (reading 'filter') error if the source (primary) environment has no models or blocks.

The command completed successfully as soon as I created a model in the primary environment.

Example command:

# `next` is the name of the sandbox environment
datocms migrations:new 'add company' --ts --autogenerate='next'
Screenshot 2023-06-26 at 16 51 24
illarionvk commented 1 year ago

I can see that the issue is addressed in this commit; but v1.1.8 release is yet not available on npm.

stefanoverna commented 1 year ago

Sorry for the inconvenience, please try with v1.1.9!