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

20190723153247_create_allowed_email_domains_for_groups.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6c5b56ed8b5acbc28d20bf77f0222b6c4c9fda6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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