From 32c48443b55c43b0f31de454d5d0163fd9866149 Mon Sep 17 00:00:00 2001 From: Arshad <49522121+arshad-k7@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:40:47 +0530 Subject: [PATCH] adding exists check before dropping constraints (#5363) Co-authored-by: Arshad Khan --- pkg/sqlite/migrations/62_performer_urls.up.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/sqlite/migrations/62_performer_urls.up.sql b/pkg/sqlite/migrations/62_performer_urls.up.sql index cebfa86d6..d30734637 100644 --- a/pkg/sqlite/migrations/62_performer_urls.up.sql +++ b/pkg/sqlite/migrations/62_performer_urls.up.sql @@ -144,9 +144,9 @@ INSERT INTO `performer_urls` FROM `performers` WHERE `performers`.`instagram` IS NOT NULL AND `performers`.`instagram` != ''; -DROP INDEX `performers_name_disambiguation_unique`; -DROP INDEX `performers_name_unique`; -DROP TABLE `performers`; +DROP INDEX IF EXISTS `performers_name_disambiguation_unique`; +DROP INDEX IF EXISTS `performers_name_unique`; +DROP TABLE IF EXISTS `performers`; ALTER TABLE `performers_new` rename to `performers`; CREATE UNIQUE INDEX `performers_name_disambiguation_unique` on `performers` (`name`, `disambiguation`) WHERE `disambiguation` IS NOT NULL;