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

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

class CreateOperationsStrategiesUserLists < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def change
    create_table :operations_strategies_user_lists do |t|
      t.references :strategy, index: false, foreign_key: { on_delete: :cascade, to_table: :operations_strategies }, null: false
      t.references :user_list, index: true, foreign_key: { on_delete: :cascade, to_table: :operations_user_lists }, null: false

      t.index [:strategy_id, :user_list_id], unique: true, name: :index_ops_strategies_user_lists_on_strategy_id_and_user_list_id
    end
  end
end