During the upgrade of a DB Partitioning environment we execute every upgrade process once per company. In some cases we iterate over companies in those upgrades and we even set the CompanyThreadLocal, that's wrong. Every company upgrade should only access to its specific schema.
In this ticket we will analyze how to deal with this.
For example, one approach can be -> if DBPartition is enabled and we are upgrading, only return the one in the CompanyThreadLocal. We can create a method to iterate over companies in an Upgrade or Verify Process to have control over this.