debian-mirror-gitlab/db/migrate/20190514105711_create_ip_restriction.rb

21 lines
636 B
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# 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
2020-05-24 23:13:21 +05:30
t.string :range, null: false # rubocop:disable Migration/PreventStrings
2019-09-04 21:01:54 +05:30
end
add_foreign_key(:ip_restrictions, :namespaces, column: :group_id, on_delete: :cascade) # rubocop: disable Migration/AddConcurrentForeignKey
end
end