20160705055809_remove_developers_can_push_from_protected_branches.rb 611 Bytes
Newer Older
1
# rubocop:disable Migration/RemoveColumn
2 3 4
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

5
class RemoveDevelopersCanPushFromProtectedBranches < ActiveRecord::Migration[4.2]
6 7 8 9 10 11 12 13
  include Gitlab::Database::MigrationHelpers

  # This is only required for `#down`
  disable_ddl_transaction!

  DOWNTIME = false

  def up
14 15
    remove_column :protected_branches, :developers_can_push, :boolean
  end
16 17

  def down
18
    add_column_with_default(:protected_branches, :developers_can_push, :boolean, default: false, allow_null: false)
19
  end
20
end