diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:19 +0000 |
commit | e6baeabaa9651d90b03bb64ffce75a2c3cb89aab (patch) | |
tree | 85f3cbd6e437b17be59505cf3ac4794c1838609e /db/migrate/20200318140400_create_vulnerability_user_mentions.rb | |
parent | 5064bf8c5647d4c4430cbb4d097cf1592416de29 (diff) | |
download | gitlab-ce-e6baeabaa9651d90b03bb64ffce75a2c3cb89aab.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200318140400_create_vulnerability_user_mentions.rb')
-rw-r--r-- | db/migrate/20200318140400_create_vulnerability_user_mentions.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200318140400_create_vulnerability_user_mentions.rb b/db/migrate/20200318140400_create_vulnerability_user_mentions.rb new file mode 100644 index 00000000000..919bc94cfa6 --- /dev/null +++ b/db/migrate/20200318140400_create_vulnerability_user_mentions.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateVulnerabilityUserMentions < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def change + create_table :vulnerability_user_mentions do |t| + t.references :vulnerability, type: :bigint, index: false, null: false, foreign_key: { on_delete: :cascade } + t.references :note, type: :integer, + index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade } + t.integer :mentioned_users_ids, array: true + t.integer :mentioned_projects_ids, array: true + t.integer :mentioned_groups_ids, array: true + end + + add_index :vulnerability_user_mentions, [:vulnerability_id], where: 'note_id is null', unique: true, name: 'index_vulns_user_mentions_on_vulnerability_id' + add_index :vulnerability_user_mentions, [:vulnerability_id, :note_id], unique: true, name: 'index_vulns_user_mentions_on_vulnerability_id_and_note_id' + end +end |