Skip to content

Commit

Permalink
Merge pull request #3070 from bomoko/hotfix/updates_unique_index_for_…
Browse files Browse the repository at this point in the history
…advanced_task_arguments
  • Loading branch information
tobybellwood authored Mar 16, 2022
2 parents 94324ba + e367fe0 commit a4cbda3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions services/api-db/docker-entrypoint-initdb.d/01-migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,20 @@ CREATE OR REPLACE PROCEDURE
END;
$$

CREATE OR REPLACE PROCEDURE
change_name_index_for_advanced_task_argument()
BEGIN
IF EXISTS(
SELECT null FROM INFORMATION_SCHEMA.STATISTICS WHERE
TABLE_NAME = 'advanced_task_definition_argument' and INDEX_NAME = 'name'
) THEN
ALTER TABLE `advanced_task_definition_argument`
DROP INDEX `name`;
ALTER TABLE `advanced_task_definition_argument` ADD CONSTRAINT advanced_task_definition_argument_unique UNIQUE(advanced_task_definition, name);
END IF;
END;
$$

CREATE OR REPLACE PROCEDURE
add_openshift_to_environment()

Expand Down Expand Up @@ -1642,6 +1656,7 @@ CALL add_development_build_priority_to_project();
CALL add_priority_to_deployment();
CALL add_bulk_id_to_deployment();
CALL drop_legacy_permissions();
CALL change_name_index_for_advanced_task_argument();

-- Drop legacy SSH key procedures
DROP PROCEDURE IF EXISTS CreateProjectSshKey;
Expand Down

0 comments on commit a4cbda3

Please sign in to comment.