From c8cbb36fd55759b4f8f2bd7ea8dda96f538e2ec2 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 30 Sep 2022 15:59:29 +1000 Subject: [PATCH] Ignore multiple identical rows in performers_scenes --- pkg/sqlite/migrations/35_assoc_tables.up.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/sqlite/migrations/35_assoc_tables.up.sql b/pkg/sqlite/migrations/35_assoc_tables.up.sql index c271b2cab..6bc73f189 100644 --- a/pkg/sqlite/migrations/35_assoc_tables.up.sql +++ b/pkg/sqlite/migrations/35_assoc_tables.up.sql @@ -112,7 +112,8 @@ INSERT INTO `performers_scenes_new` SELECT `performer_id`, `scene_id` - FROM `performers_scenes`; + FROM `performers_scenes` + ON CONFLICT (`scene_id`, `performer_id`) DO NOTHING; DROP TABLE `performers_scenes`; ALTER TABLE `performers_scenes_new` rename to `performers_scenes`;