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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 15:06:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 15:06:00 +0300
commitb570d73ecd31e2ca9cf8c2f1adb056edf2869477 (patch)
tree0b8aa67eab6da552d8499f1fdcf9a7495dcf1379 /db/migrate/20191003130045_create_issue_user_mentions.rb
parent34b3567c97ecc0f317adae04e10e4d7d8c8830db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20191003130045_create_issue_user_mentions.rb')
-rw-r--r--db/migrate/20191003130045_create_issue_user_mentions.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20191003130045_create_issue_user_mentions.rb b/db/migrate/20191003130045_create_issue_user_mentions.rb
new file mode 100644
index 00000000000..e465a307f44
--- /dev/null
+++ b/db/migrate/20191003130045_create_issue_user_mentions.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class CreateIssueUserMentions < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :issue_user_mentions do |t|
+ t.references :issue, type: :integer, 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 :issue_user_mentions, [:issue_id], where: 'note_id is null', unique: true, name: 'issue_user_mentions_on_issue_id_index'
+ add_index :issue_user_mentions, [:issue_id, :note_id], unique: true, name: 'issue_user_mentions_on_issue_id_and_note_id_index'
+ end
+end