gitlab-org--gitlab-foss/db/migrate/20190514105711_create_ip_restriction.rb
2019-06-17 15:20:43 +00:00

20 lines
593 B
Ruby

# frozen_string_literal: true
class CreateIpRestriction < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :ip_restrictions do |t|
t.references :group, references: :namespace,
column: :group_id,
type: :integer,
null: false,
index: true
t.string :range, null: false
end
add_foreign_key(:ip_restrictions, :namespaces, column: :group_id, on_delete: :cascade) # rubocop: disable Migration/AddConcurrentForeignKey
end
end