8.4.2: InvalidFieldNameException - Column not found

Permalink
I have an on_page_view event in the package controller on_start() where I have to get an object by its page ID. So visiting any page after the upgrade triggers that event.

1. If I have Doctrine Development Mode OFF in Dashboard and
2. if I change DB columns in a new version of a package and
3. then upgrade it even with forced entities refresh:
$em = DatabaseORM::entityManager();
$manager = new DatabaseStructureManager($em);
$manager->refreshEntities();

The site crashes with a Doctrine \ DBAL \ Exception \ InvalidFieldNameException:
An exception occurred while executing 'SELECT ... SQLSTATE[42S22]: Column not found: 1054 Unknown column

Checking the DB shows the entities don't update during the upgrade.
That exception does not happen if the Doctrine Development Mode is ON.

If that's a bug which prevents entity refresh, it's obviously gonna result in the exception on every page. Is there any way to update the entities any other way during package upgrade?

linuxoid