You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/10/21 06:01:12 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4034: Make DB upgrade queries idempotent for convenience

GabrielBrascher commented on a change in pull request #4034:
URL: https://github.com/apache/cloudstack/pull/4034#discussion_r509009011



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41310to41400-cleanup.sql
##########
@@ -25,4 +25,4 @@ DELETE FROM `cloud`.`configuration` WHERE name = 'host.maintenance.retries';
 UPDATE `cloud`.`storage_pool` SET path="/var/lib/libvirt/images" WHERE path="/var/lib/libvirt/images/";
 
 -- remove (one of) duplicate unique indexes from Region table
-ALTER TABLE `region` DROP INDEX `id_3`;
+ALTER TABLE `region` DROP INDEX IF EXISTS `id_3`;

Review comment:
       @rhtyd are yiou using mongoDB or mariaDB?
   
   I just execcuted it on a Mysql and it indeed fails:
   ```
   myysql> ALTER TABLE `region` DROP INDEX IF EXISTS `id_3`;
   ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `id_3`' at line 1
   ```




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

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