Bug report: collection_appearance changes when migrating

I have generated a migration using npx datocms migrations:new --autogenerate my-migration. The generated migration changes some models in unrelated ways (draft_mode_active: true and/or all_locales_required: false).

An excerpt from the migration script looks like this:

  console.log('Finalize models/block models')

  console.log('Update model "My Model" (`my_model`)')
  await client.itemTypes.update('1234', { all_locales_required: false })

  console.log('Update model "Other Model" (`other_model`)')
  await client.itemTypes.update('1235', {
    draft_mode_active: true,
    all_locales_required: false,
  })

In the primary environment all models have "collection_appearance": "table" but when I run the migration the new environment have all models set to "collection_appearance": "compact".

I’ve tried manually adding "collection_appearance": "table" to the migration and that works so I’m able to use it as a workaround.

Hey @gabriel1

Thank you for the report!
And I’ll get back to you as soon as we have any updates

Hey @gabriel1, I would like to reproduce the error, but I need the details of the project and the environments involved. Can you help me?

You can also send these details by sending an email to support@datocms.com, thank you!

I’ve sent the support email a zip file with a minimal reproduction of the problem. It contains two migrations that, when run in turn, will have produced a new environment with the model migration_test_model where collection_appearance have become compact even though the migration does not change that particular property :slight_smile:

@gabriel1 we just shipped a fix for this issue!

Thank you once again for the detailed reproduction of the issue via email :slight_smile:

1 Like

Thanks for the quick resolution! I can confirm that it works fine now :+1: