shwstppr commented on code in PR #10300:
URL: https://github.com/apache/cloudstack/pull/10300#discussion_r1940573142


##########
engine/schema/src/main/java/com/cloud/upgrade/dao/DbUpgradeUtils.java:
##########
@@ -58,4 +58,21 @@ public static void dropTableColumnsIfExist(Connection conn, 
String tableName, Li
         }
     }
 
+    public static String getTableColumnType(Connection conn, String tableName, 
String columnName) {
+        return dao.getColumnType(conn, tableName, columnName);
+    }
+
+    public static void addTableColumnIfNotExist(Connection conn, String 
tableName, String columnName, String columnDefinition) {
+        if (!dao.columnExists(conn, tableName, columnName)) {
+            dao.addColumn(conn, tableName, columnName, columnDefinition);
+        }
+    }
+
+    public static void changeTableColumnIfNotExist(Connection conn, String 
tableName, String oldColumnName, String newColumnName, String columnDefinition) 
{
+        if (dao.columnExists(conn, tableName, oldColumnName)) {
+            System.out.println("column exists------------------------" + 
oldColumnName);

Review Comment:
   this can be removed?



##########
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java:
##########
@@ -183,10 +185,15 @@ public void setDescription(String description) {
     }
 
     @Override
-    public String getScope() {
+    public int getScope() {

Review Comment:
   @abh1sar we have defined scope as Integer but returning int. Please check if 
this won't cause an issue



##########
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42100.java:
##########
@@ -80,4 +87,35 @@ public void updateSystemVmTemplates(Connection conn) {
             throw new CloudRuntimeException("Failed to find / register 
SystemVM template(s)");
         }
     }
+
+    protected void migrateConfigurationScopeToBitmask(Connection conn) {
+        String scopeDataType = DbUpgradeUtils.getTableColumnType(conn, 
"configuration", "scope");
+        logger.info("------------------------{}", scopeDataType);

Review Comment:
   this can be removed or rephrased if needed



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to