gitlab-org--gitlab-foss/db/migrate/20190703001120_default_milestone_to_nil.rb
charlie ablett 5d7b46d523 Port CE changes from EE
- DB migration of board milestone values
- issue finder & spec updates
2019-07-31 13:51:46 +00:00

24 lines
412 B
Ruby

# frozen_string_literal: true
class DefaultMilestoneToNil < ActiveRecord::Migration[5.1]
DOWNTIME = false
def up
execute(update_board_milestones_query)
end
def down
# no-op
end
private
# Only 105 records to update, as of 2019/07/18
def update_board_milestones_query
<<~HEREDOC
UPDATE boards
SET milestone_id = NULL
WHERE boards.milestone_id = -1
HEREDOC
end
end