Skip to content

Commit

Permalink
adding exists check before dropping constraints (#5363)
Browse files Browse the repository at this point in the history
Co-authored-by: Arshad Khan <arshad@Arshads-MacBook-Air-2.local>
  • Loading branch information
arshad-k7 and Arshad Khan authored Oct 15, 2024
1 parent ad00bee commit 32c4844
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/sqlite/migrations/62_performer_urls.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 32c4844

Please sign in to comment.