debian-mirror-gitlab/db/migrate/20200210184420_create_operations_scopes_table.rb

17 lines
550 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
class CreateOperationsScopesTable < ActiveRecord::Migration[6.0]
DOWNTIME = false
2020-05-24 23:13:21 +05:30
# rubocop:disable Migration/PreventStrings
2020-03-13 15:44:24 +05:30
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-05-24 23:13:21 +05:30
# rubocop:enable Migration/PreventStrings
2020-03-13 15:44:24 +05:30
end