summaryrefslogtreecommitdiff
path: root/db/migrate/20210203092540_remove_has_external_wiki_constraint.rb
blob: 80b0cc11685cd2bd6e10f09eeadc2964ee8e3657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    # This reverts the following migration: add_not_null_constraint :projects, :has_external_wiki, validate: false
    if check_not_null_constraint_exists?(:projects, :has_external_wiki)
      remove_not_null_constraint :projects, :has_external_wiki
    end
  end

  def down
    # no-op
  end
end