summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorash wilson <smashwilson@gmail.com>2013-05-30 23:16:49 +0000
committerAsh Wilson <smashwilson@gmail.com>2013-08-25 18:58:41 -0400
commitc8a115c0e3a9c8242c2a422572d47a49e0cb2874 (patch)
tree5a36c3e0f364fdfb710e01090fc81b9676ea53c4 /db
parent2b36dee64485062c69779217d4a202e5ca1b67bd (diff)
downloadgitlab-ce-c8a115c0e3a9c8242c2a422572d47a49e0cb2874.tar.gz
Link issues from comments and automatically close them
Any mention of Issues, MergeRequests, or Commits via GitLab-flavored markdown references in descriptions, titles, or attached Notes creates a back-reference Note that links to the original referencer. Furthermore, pushing commits with commit messages that match a (configurable) regexp to a project's default branch will close any issues mentioned by GFM in the matched closing phrase. If accepting a merge request would close any Issues in this way, a banner is appended to the merge request's main panel to indicate this.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130528184641_add_system_to_notes.rb16
-rw-r--r--db/schema.rb1
2 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20130528184641_add_system_to_notes.rb b/db/migrate/20130528184641_add_system_to_notes.rb
new file mode 100644
index 00000000000..1b22a4934f9
--- /dev/null
+++ b/db/migrate/20130528184641_add_system_to_notes.rb
@@ -0,0 +1,16 @@
+class AddSystemToNotes < ActiveRecord::Migration
+ class Note < ActiveRecord::Base
+ end
+
+ def up
+ add_column :notes, :system, :boolean, default: false, null: false
+
+ Note.reset_column_information
+ Note.update_all(system: false)
+ Note.where("note like '_status changed to%'").update_all(system: true)
+ end
+
+ def down
+ remove_column :notes, :system
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 429551a2bf4..5020230d831 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -152,6 +152,7 @@ ActiveRecord::Schema.define(:version => 20130821090531) do
t.string "commit_id"
t.integer "noteable_id"
t.text "st_diff"
+ t.boolean "system", :default => false, :null => false
end
add_index "notes", ["author_id"], :name => "index_notes_on_author_id"