2020-02-13 19:09:07 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateOperationsScopesTable < ActiveRecord::Migration[6.0]
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2020-04-21 11:21:10 -04:00
|
|
|
# rubocop:disable Migration/PreventStrings
|
2020-02-13 19:09:07 -05:00
|
|
|
def change
|
|
|
|
create_table :operations_scopes do |t|
|
|
|
|
t.references :strategy, null: false, index: false, foreign_key: { to_table: :operations_strategies, on_delete: :cascade }
|
|
|
|
t.string :environment_scope, null: false, limit: 255
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index :operations_scopes, [:strategy_id, :environment_scope], unique: true
|
|
|
|
end
|
2020-04-21 11:21:10 -04:00
|
|
|
# rubocop:enable Migration/PreventStrings
|
2020-02-13 19:09:07 -05:00
|
|
|
end
|