summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2019-07-03 13:01:05 +0800
committerAlex Buijs <abuijs@gitlab.com>2019-08-02 17:03:30 +0200
commitcf12dc2c13616b230443a8271a4de6dc5b9e30e6 (patch)
treec4ec42b4fb073dbbc091070c4f502c43eaa801b0
parent9e35003bdc99d04775f50fe7e356704f236179cb (diff)
downloadgitlab-ce-cf12dc2c13616b230443a8271a4de6dc5b9e30e6.tar.gz
Add commit_id to draft_notes table
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14520
-rw-r--r--db/migrate/20190703043358_add_commit_id_to_draft_notes.rb11
-rw-r--r--db/schema.rb1
-rw-r--r--spec/db/schema_spec.rb2
3 files changed, 13 insertions, 1 deletions
diff --git a/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb b/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb
new file mode 100644
index 00000000000..022400ce585
--- /dev/null
+++ b/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddCommitIdToDraftNotes < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ add_column :draft_notes, :commit_id, :binary
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3d229c2353b..709f9ce2541 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1136,6 +1136,7 @@ ActiveRecord::Schema.define(version: 2019_07_31_084415) do
t.text "position"
t.text "original_position"
t.text "change_position"
+ t.binary "commit_id"
t.index ["author_id"], name: "index_draft_notes_on_author_id"
t.index ["discussion_id"], name: "index_draft_notes_on_discussion_id"
t.index ["merge_request_id"], name: "index_draft_notes_on_merge_request_id"
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index 13fad1b6dc9..232890b1bba 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -27,7 +27,7 @@ describe 'Database schema' do
cluster_providers_gcp: %w[gcp_project_id operation_id],
deploy_keys_projects: %w[deploy_key_id],
deployments: %w[deployable_id environment_id user_id],
- draft_notes: %w[discussion_id],
+ draft_notes: %w[discussion_id commit_id],
emails: %w[user_id],
events: %w[target_id],
epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id],