mlsorensen commented on code in PR #7922:
URL: https://github.com/apache/cloudstack/pull/7922#discussion_r1309212546


##########
engine/schema/src/main/java/com/cloud/upgrade/dao/DatabaseAccessObject.java:
##########
@@ -84,6 +85,31 @@ public boolean columnExists(Connection conn, String 
tableName, String columnName
         return columnExists;
     }
 
+    public void addIndexIfNeeded(Connection conn, String tableName, String 
columnName) {

Review Comment:
   Before I do this rework, looking for feedback. Do we want to:
   
   1) create index naming function to generate index name
   2) call indexExists with tableName and indexName
   3) call createIndex with tableName and indexName
   
   It seems to me we would prefer to keep the index naming scheme private to 
outside callers so it isn't something overridable and no potential for 
mismatches between checking existence and creating - which leads me to think we 
would want to retain a single entry point function like the `addIndexIfNeeded` 
to generate the name privately and then call `indexExists` and `createIndex` if 
we still want to break these out.



-- 
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]

Reply via email to