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
diff options
context:
space:
mode:
authorGosia Ksionek <mksionek@gitlab.com>2019-08-17 01:04:21 +0300
committerPaul Slaughter <pslaughter@gitlab.com>2019-08-17 01:04:21 +0300
commit3b32ac567848990094dc4bd4e67a32c6e22b61e8 (patch)
tree9f75f5f25a1f9d1217b74b9727563bb9ccbc3a17 /db/migrate
parent0baadb42e2a0a3aecdb0b9792743887998efbcf8 (diff)
Add new table to store email domain
In order to save user preferences regarding user emails allowed to be invited to group Add foreign_key and down method Change adding foreign key Add partial call to view Add changelog entry Fix schema
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb b/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb
new file mode 100644
index 00000000000..c6c5b56ed8b
--- /dev/null
+++ b/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class CreateAllowedEmailDomainsForGroups < ActiveRecord::Migration[5.2]
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ create_table :allowed_email_domains do |t|
+ t.timestamps_with_timezone null: false
+ t.references :group, references: :namespace,
+ column: :group_id,
+ type: :integer,
+ null: false,
+ index: true
+ t.foreign_key :namespaces, column: :group_id, on_delete: :cascade
+ t.string :domain, null: false, limit: 255
+ end
+ end
+end