File obs-server-2.9-0103-frontend-Rails-5.2-Fix-checking-if-data-migration-wa.patch of Package obs-server

From a92bb4e12f07630500e161fb7c02624045d0e2f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= <bgeuken@suse.de>
Date: Tue, 22 May 2018 17:22:31 +0200
Subject: [PATCH] [frontend] Rails 5.2: Fix checking if data migration was run

This changed with Rails 5.2.
---
 ...84558_change_repositories_remote_project_name_to_not_null.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/api/db/migrate/20170306084558_change_repositories_remote_project_name_to_not_null.rb b/src/api/db/migrate/20170306084558_change_repositories_remote_project_name_to_not_null.rb
index 5b96f9d25b..f727259408 100644
--- a/src/api/db/migrate/20170306084558_change_repositories_remote_project_name_to_not_null.rb
+++ b/src/api/db/migrate/20170306084558_change_repositories_remote_project_name_to_not_null.rb
@@ -3,7 +3,7 @@ class ChangeRepositoriesRemoteProjectNameToNotNull < ActiveRecord::Migration[5.0
     # We need to run src/api/db/data/20170306084550_remove_duplicate_repositories.rb first,
     # otherwise we will get duplicate entry exception when we set remote_project_name to an empty string
     msg = 'Pending data migration 20170306084550. Please run rake db:migrate:with_data.'
-    raise ActiveRecord::ActiveRecordError, msg unless DataMigrate::DataMigrator.get_all_versions.include?(20_170_306_084_550)
+    raise ActiveRecord::ActiveRecordError, msg unless DataMigrate::DataSchemaMigration.where(version: 20_170_306_084_550).exists?
     change_column_null :repositories, :remote_project_name, false
     change_column_default :repositories, :remote_project_name, ''
   end
-- 
2.25.3