ernjvr commented on a change in pull request #2449: WIP CLOUDSTACK-10278 idempotent column addition URL: https://github.com/apache/cloudstack/pull/2449#discussion_r168703831
########## File path: engine/schema/resources/META-INF/db/schema-41000to41100.sql ########## @@ -19,8 +19,54 @@ -- Schema upgrade from 4.10.0.0 to 4.11.0.0 --; +--; +-- Stored procedure to do idempotent column add; +--; +DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_COLUMN`; Review comment: @rafaelweingartner yes, we will have to make sure that everyone creating new scripts to add a new column, drop a foreign key or create/drop indexes, call these stored procedures, to ensure their SQL statements are idempotent. @rhtyd These 'drop procedure' statements are placed before each 'create procedure' statement only. So when the upgrade script runs, the procedures are created but not dropped after the script completes. Therefore the stored procedures will still exist in the database. So they will be available (reusable) to future versions of schema-nn-nn.sql migration scripts. I think these 'drop/create procedure' statements also need to be added to the setup/db/create-schema.sql script to make them available to new cs installs, including the simulator. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
