mysql-migrations/upgrade_126: one more weird...

...index bound to die

fixes #13859
This commit is contained in:
Thomas Gelf 2017-01-03 17:09:34 +01:00
parent 012b302386
commit e64e4de678
1 changed files with 20 additions and 0 deletions

View File

@ -52,6 +52,26 @@ DEALLOCATE PREPARE stmt;
SET @stmt = NULL; SET @stmt = NULL;
SET @stmt = (SELECT IF(
(SELECT EXISTS(
SELECT * FROM information_schema.table_constraints
WHERE
table_schema = DATABASE()
AND table_name = 'icinga_service_set'
AND constraint_name = 'icinga_service_set_ibfk_3'
)),
'ALTER TABLE icinga_service_set DROP FOREIGN KEY icinga_service_set_ibfk_3',
'SELECT 1'
));
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @stmt = NULL;
SET @stmt = (SELECT IF( SET @stmt = (SELECT IF(
(SELECT EXISTS( (SELECT EXISTS(
SELECT * FROM information_schema.table_constraints SELECT * FROM information_schema.table_constraints