diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-06-17 15:20:43 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-06-17 15:20:43 +0000 |
commit | 1ac1f1f63bc0f209fd1dde06c99cab754fd42f6b (patch) | |
tree | 20b09ada122eba9d307ffde51d70982259e02732 /db/migrate | |
parent | 63043b6fb67bbc69981f4a36b046d56585975501 (diff) | |
download | gitlab-ce-1ac1f1f63bc0f209fd1dde06c99cab754fd42f6b.tar.gz |
CE port of IP address restriction for groups
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20190514105711_create_ip_restriction.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20190514105711_create_ip_restriction.rb b/db/migrate/20190514105711_create_ip_restriction.rb new file mode 100644 index 00000000000..dfafbe32ad1 --- /dev/null +++ b/db/migrate/20190514105711_create_ip_restriction.rb @@ -0,0 +1,20 @@ +# 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 |