Delete identical rows from performer_stash_ids

This commit is contained in:
WithoutPants 2022-09-30 17:25:40 +10:00 committed by GitHub
parent 8f594e7fed
commit 30f7a05ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -315,6 +315,16 @@ ALTER TABLE `scene_stash_ids_new` rename to `scene_stash_ids`;
-- CREATE INDEX `index_scene_stash_ids_on_scene_id` ON `scene_stash_ids` (`scene_id`);
-- delete identical rows from performer_stash_ids before performing this
-- translation
DELETE FROM `performer_stash_ids` WHERE
rowid > (
SELECT MIN(rowid) FROM `performer_stash_ids` d
WHERE `performer_stash_ids`.`performer_id` = d.`performer_id` AND
`performer_stash_ids`.`endpoint` = d.`endpoint` AND
`performer_stash_ids`.`stash_id` = d.`stash_id`
);
CREATE TABLE `performer_stash_ids_new` (
`performer_id` integer NOT NULL,
`endpoint` varchar(255) NOT NULL,