Auto-generated migration script bugs

There are some frustrating bugs when generating a migration script using the auto-generate tool.

  1. If there is a model in the target with a different api name but the same visual name as one that is being added, it will throw an error.
  2. When deleting blocks, it may try to delete a block that is depended on by another block instead of deleting the parent block first, so it throws an error. This also isn’t caught in a dry run.

Thank you the reports @fitzage! I have reproduced and confirmed both situations and reported them to the devs. I will let you know once one or both are fixed. Sorry about that!

1 Like

@fitzage,

Sorry for the delay here. I have some interim updates:

  1. Unfortunately, this is by design. The human-readable labels in a project must also be unique, not just their API names. (I didn’t know this either. I’m asking the devs if we can at least update the docs to clarify this.)
  2. So I had the same error as you, but it turns out that was because I had forgotten to delete the earlier failing migrations script from bug #1. It was running them in order from the same folder, and kept failing on the first script. Once I deleted that, the actual deletion of parent blocks seemed to work fine. Can you please confirm whether that’s the case for you (i.e. you’re sure it’s the block deletion that’s broken, not just the migration tool trying to run another script?). If you could please provide an example or screenshot, that would be very helpful.

Sorry about that!

Hmm, I don’t have something currently that fits the requirements for the bug. I’ll try to work something up in the near future for testing and let you know.

It’s possible that it only happened when I had partial runs, but I’m pretty sure that wasn’t the case every time.

I had a block that depended on two other blocks, and it was always trying to delete the child blocks first, which of course failed.

I tried to replicate that but could not… there may be some circumstances under which this would happen (and to be clear, that would be a bug), I just haven’t been able to nail those down yet :frowning: If you do notice it happening on a pattern, or manage to come up with a reproduction, please do let us know!