summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml6
-rw-r--r--lib/gitlab/background_migration/fix_cross_project_label_links.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml b/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml
new file mode 100644
index 00000000000..e95536b213c
--- /dev/null
+++ b/changelogs/unreleased/48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml
@@ -0,0 +1,6 @@
+---
+title: "[Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass
+ of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace'"
+merge_request: 20462
+author: "@blackst0ne"
+type: fixed
diff --git a/lib/gitlab/background_migration/fix_cross_project_label_links.rb b/lib/gitlab/background_migration/fix_cross_project_label_links.rb
index fa68ba5cca7..0a12401c35f 100644
--- a/lib/gitlab/background_migration/fix_cross_project_label_links.rb
+++ b/lib/gitlab/background_migration/fix_cross_project_label_links.rb
@@ -11,6 +11,7 @@ module Gitlab
end
class Label < ActiveRecord::Base
+ self.inheritance_column = :_type_disabled
self.table_name = 'labels'
end
@@ -27,6 +28,7 @@ module Gitlab
end
class Namespace < ActiveRecord::Base
+ self.inheritance_column = :_type_disabled
self.table_name = 'namespaces'
def self.groups_with_descendants_ids(start_id, stop_id)