Dependent model breaks after removing custom field in base model

Hi everyone,

I have a base model (let’s call it model 1), and another model (model 2) that is built on top of model 1.

In model 1, I had a custom field named "Total tid (timmar)". After I deleted that field, model 2 stopped working and gave the following error:

ERROR: column source."Total tid (timmar)" does not exist Position: 3560

The sql for model 2 still have references to the field. How do I do this sort of actions correctly?

I can resolve it with a workaround but it seems quite cumbersome.

  1. Re-add the missing field in model 1 and save.
  2. Open model 2, edit it, and de-select or remove the field causing the error. Save.
  3. Go back to model 1 and delete the field again. Save

Revert to a previous version of model 1. It's in the Info tab of the model: