shwstppr commented on code in PR #10485:
URL: https://github.com/apache/cloudstack/pull/10485#discussion_r2000834870
##########
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42100.java:
##########
@@ -98,6 +100,8 @@ protected void migrateConfigurationScopeToBitmask(Connection
conn) {
migrateExistingConfigurationScopeValues(conn);
DbUpgradeUtils.dropTableColumnsIfExist(conn, "configuration",
List.of("scope"));
DbUpgradeUtils.changeTableColumnIfNotExist(conn, "configuration",
"new_scope", "scope", "BIGINT NOT NULL DEFAULT 0 COMMENT 'Bitmask for scope(s)
of this parameter'");
+ ConfigurationDao dao = new ConfigurationDaoImpl();
+ dao.markForColumnsRefresh();
Review Comment:
@JoaoJandre cc @abh1sar there could be a better way to refresh columns but I
wasn't able to do it after the upgrade from this class. At runtime, we have a
different ConfigurationDaoImpl instance which was created as the bean and needs
columns refresh. I was not being able to access it from here directly. Maybe
something like this can help,
```
try {
ConfigurationDao dao =
ComponentContext.getDelegateComponentOfType(ConfigurationDao.class);
dao.refreshColumns();
} catch (NoSuchBeanDefinitionException ignored) {
logger.debug("No ConfigurationDao bean found");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]