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

20190703001120_default_milestone_to_nil.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6a1c3603d9dfd31b8f83a8cad1ba7cf6a457de25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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