Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210121093618_remove_repository_read_only_to_groups.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b353ba5d8832c86f2050d9fe853190a5819f932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class RemoveRepositoryReadOnlyToGroups < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    if column_exists?(:namespaces, :repository_read_only)
      with_lock_retries do
        remove_column :namespaces, :repository_read_only # rubocop:disable Migration/RemoveColumn
      end
    end
  end

  def down
    unless column_exists?(:namespaces, :repository_read_only)
      with_lock_retries do
        add_column :namespaces, :repository_read_only, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
      end
    end
  end
end