FIX: Make migration resilient against duplicate site settings

FIX: Make migration resilient against duplicate site settings

diff --git a/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb b/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
index afd0485..c47ff92 100644
--- a/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
+++ b/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
@@ -27,7 +27,7 @@ class AddMissingTopicIdSiteSettings < ActiveRecord::Migration[5.2]
           SELECT 1
           FROM site_settings
           WHERE name = 'lounge_welcome_topic_id'
-        ) AND category_id = (
+        ) AND category_id IN (
         SELECT value::INT
         FROM site_settings
         WHERE name = 'lounge_category_id'

GitHub sha: 467c17da

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: