DEV: only skip migration if a non seeded upload exists

DEV: only skip migration if a non seeded upload exists

Followup to 667b9801

diff --git a/app/jobs/onceoff/migrate_url_site_settings.rb b/app/jobs/onceoff/migrate_url_site_settings.rb
index 4ddb2f3..c2641b7 100644
--- a/app/jobs/onceoff/migrate_url_site_settings.rb
+++ b/app/jobs/onceoff/migrate_url_site_settings.rb
@@ -18,8 +18,8 @@ module Jobs
     def execute_onceoff(args)
       SETTINGS.each do |old_setting, new_setting|
 
-        if upload_id = SiteSetting.get(new_setting)
-          logger.warn("Skipping migration of the Site Setting #{new_setting} to url cause upload #{upload_id} already exists for it")
+        if (upload = SiteSetting.get(new_setting)) && upload.id >= Upload::SEEDED_ID_THRESHOLD
+          logger.warn("Skipping migration of the Site Setting #{new_setting} to url cause upload #{upload} already exists for it")
           next
         end

GitHub sha: 457be894

1 Like