Fix migration failure when groups are missing route
When a Group is missing a route, the migration failed previously with a `Invalid single-table inheritance type` error. To fix this, we can disable STI for the migration class because we don't need to know about the type to do this migration. Besides, currently Group is the only type used in the type column. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58714
This commit is contained in:
parent
2ad5b30b6c
commit
a52cbf6b00
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix migration failure when groups are missing route
|
||||
merge_request: 29022
|
||||
author:
|
||||
type: fixed
|
|
@ -98,6 +98,7 @@ class GenerateMissingRoutes < ActiveRecord::Migration[4.2]
|
|||
|
||||
class Namespace < ActiveRecord::Base
|
||||
self.table_name = 'namespaces'
|
||||
self.inheritance_column = :_type_disabled
|
||||
|
||||
include EachBatch
|
||||
include GenerateMissingRoutes::Routable
|
||||
|
|
|
@ -8,7 +8,7 @@ describe GenerateMissingRoutes, :migration do
|
|||
let(:routes) { table(:routes) }
|
||||
|
||||
it 'creates routes for projects without a route' do
|
||||
namespace = namespaces.create!(name: 'GitLab', path: 'gitlab')
|
||||
namespace = namespaces.create!(name: 'GitLab', path: 'gitlab', type: 'Group')
|
||||
|
||||
routes.create!(
|
||||
path: 'gitlab',
|
||||
|
|
Loading…
Reference in New Issue