Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2019-06-17 18:20:43 +0300
committerDouwe Maan <douwe@gitlab.com>2019-06-17 18:20:43 +0300
commit1ac1f1f63bc0f209fd1dde06c99cab754fd42f6b (patch)
tree20b09ada122eba9d307ffde51d70982259e02732 /db
parent63043b6fb67bbc69981f4a36b046d56585975501 (diff)
CE port of IP address restriction for groups
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190514105711_create_ip_restriction.rb20
-rw-r--r--db/schema.rb7
2 files changed, 27 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
diff --git a/db/schema.rb b/db/schema.rb
index db1ef81ede6..ef4ec57acec 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1051,6 +1051,12 @@ ActiveRecord::Schema.define(version: 20190611161641) do
t.index ["usage", "project_id"], name: "index_internal_ids_on_usage_and_project_id", unique: true, where: "(project_id IS NOT NULL)", using: :btree
end
+ create_table "ip_restrictions", force: :cascade do |t|
+ t.integer "group_id", null: false
+ t.string "range", null: false
+ t.index ["group_id"], name: "index_ip_restrictions_on_group_id", using: :btree
+ end
+
create_table "issue_assignees", id: false, force: :cascade do |t|
t.integer "user_id", null: false
t.integer "issue_id", null: false
@@ -2565,6 +2571,7 @@ ActiveRecord::Schema.define(version: 20190611161641) do
add_foreign_key "import_export_uploads", "projects", on_delete: :cascade
add_foreign_key "internal_ids", "namespaces", name: "fk_162941d509", on_delete: :cascade
add_foreign_key "internal_ids", "projects", on_delete: :cascade
+ add_foreign_key "ip_restrictions", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "issue_assignees", "issues", name: "fk_b7d881734a", on_delete: :cascade
add_foreign_key "issue_assignees", "users", name: "fk_5e0c8d9154", on_delete: :cascade
add_foreign_key "issue_metrics", "issues", on_delete: :cascade