From 88bfda1980944d71782ce75ae5d482e502e438fb Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:20:04 +1100 Subject: [PATCH] Ignore duplicates for movies_scenes migration --- 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 8bbb40d19..ff6e8f9a9 100644 --- a/pkg/sqlite/migrations/35_assoc_tables.up.sql +++ b/pkg/sqlite/migrations/35_assoc_tables.up.sql @@ -199,7 +199,8 @@ INSERT INTO `movies_scenes_new` `movie_id`, `scene_id`, `scene_index` - FROM `movies_scenes`; + FROM `movies_scenes` WHERE true + ON CONFLICT (`movie_id`, `scene_id`) DO NOTHING; DROP TABLE `movies_scenes`; ALTER TABLE `movies_scenes_new` rename to `movies_scenes`;