summaryrefslogtreecommitdiff
path: root/db/schema.rb
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2019-03-15 14:35:10 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2019-03-26 16:06:26 -0300
commit1db3926dd2a5de719859ea962d4e1360b375d87b (patch)
tree230c30d0012881d03a2eee0b7798f6cd4f96c7a0 /db/schema.rb
parentb0a873aae627accd604fbc50db9d2c89f6b87dbe (diff)
downloadgitlab-ce-1db3926dd2a5de719859ea962d4e1360b375d87b.tar.gz
Add multi-line suggestion migrations
Adds outdated, lines_above and lines_below columns to suggestions table. outdated - boolean which represents whether the suggestion is outdated or not. For instance, if any line changed after you left the multi-line suggestion, even though the note is not outdated, it helps tracking if the content has changed in the latest file. We cache this information in a column given it's not a cheap operation to do for every suggestion in the request time. lines_below, lines_above - persists the parsed arguments from `suggestion:-10+3` syntax, where `10` would be lines_above and 3 lines_below. We need that to dynamically calculate which lines we should monitor for outdating / persisting the correct content in from_content column.
Diffstat (limited to 'db/schema.rb')
-rw-r--r--db/schema.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/db/schema.rb b/db/schema.rb
index 0c997f3b8a2..f34a776b2b0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -2039,6 +2039,9 @@ ActiveRecord::Schema.define(version: 20190322132835) do
t.string "commit_id"
t.text "from_content", null: false
t.text "to_content", null: false
+ t.boolean "outdated", default: false, null: false
+ t.integer "lines_above", default: 0, null: false
+ t.integer "lines_below", default: 0, null: false
t.index ["note_id", "relative_order"], name: "index_suggestions_on_note_id_and_relative_order", unique: true, using: :btree
end