2020-03-12 20:09:34 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class RemoveStateFromIssues < ActiveRecord::Migration[6.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
return unless issue_state_column_exists?
|
|
|
|
|
|
|
|
# Ignored in 12.6 - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19574
|
|
|
|
with_lock_retries do
|
|
|
|
remove_column :issues, :state, :string
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
return if issue_state_column_exists?
|
|
|
|
|
|
|
|
with_lock_retries do
|
2020-04-21 11:21:10 -04:00
|
|
|
add_column :issues, :state, :string
|
2020-03-12 20:09:34 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def issue_state_column_exists?
|
|
|
|
column_exists?(:issues, :state)
|
|
|
|
end
|
|
|
|
end
|