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

20160919145149_add_group_id_to_labels.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d10f3a6d1046f765ca0283b52a7c6360d4b9a83f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class AddGroupIdToLabels < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def change
    add_column :labels, :group_id, :integer
    add_foreign_key :labels, :namespaces, column: :group_id, on_delete: :cascade # rubocop: disable Migration/AddConcurrentForeignKey
    add_concurrent_index :labels, :group_id
  end
end