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

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

class CreateResourceWeightEvent < ActiveRecord::Migration[5.2]
  DOWNTIME = false

  def change
    create_table :resource_weight_events do |t|
      t.references :user, null: false, foreign_key: { on_delete: :nullify },
                   index: { name: 'index_resource_weight_events_on_user_id' }
      t.references :issue, null: false, foreign_key: { on_delete: :cascade },
                   index: false
      t.integer :weight
      t.datetime_with_timezone :created_at, null: false

      t.index [:issue_id, :weight], name: 'index_resource_weight_events_on_issue_id_and_weight'
    end
  end
end