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

20200824124623_create_issuable_severities.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 674a54fc16dcdf1e28a026cb94ad516db31aa18b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

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

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :issuable_severities do |t|
        t.references :issue, index: { unique: true }, null: false, foreign_key: { on_delete: :cascade }
        t.integer :severity, null: false, default: 0, limit: 2 # 0 - will stand for unknown
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :issuable_severities
    end
  end
end