Commit 169b4ce0ca2ef04d37deb6bdb054cb8124a9db61

Authored by Dmitriy Zaporozhets
1 parent 88bab75a

Add new fields to web_hooks table.

Next fields were added:
* push_events
* issues_events
* merge_requests_events

Main goal is to create web hooks that can be triggered only for certain
event types. For example you can have separate web hook for push events
and another one for issues.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
db/migrate/20131202192556_add_event_fields_for_web_hook.rb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +class AddEventFieldsForWebHook < ActiveRecord::Migration
  2 + def change
  3 + add_column :web_hooks, :push_events, :boolean, default: true, null: false
  4 + add_column :web_hooks, :issues_events, :boolean, default: false, null: false
  5 + add_column :web_hooks, :merge_requests_events, :boolean, default: false, null: false
  6 + end
  7 +end
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 # 11 #
12 # It's strongly recommended to check this file into your version control system. 12 # It's strongly recommended to check this file into your version control system.
13 13
14 -ActiveRecord::Schema.define(:version => 20131112220935) do 14 +ActiveRecord::Schema.define(:version => 20131202192556) do
15 15
16 create_table "broadcast_messages", :force => true do |t| 16 create_table "broadcast_messages", :force => true do |t|
17 t.text "message", :null => false 17 t.text "message", :null => false
@@ -334,10 +334,13 @@ ActiveRecord::Schema.define(:version =&gt; 20131112220935) do @@ -334,10 +334,13 @@ ActiveRecord::Schema.define(:version =&gt; 20131112220935) do
334 create_table "web_hooks", :force => true do |t| 334 create_table "web_hooks", :force => true do |t|
335 t.string "url" 335 t.string "url"
336 t.integer "project_id" 336 t.integer "project_id"
337 - t.datetime "created_at", :null => false  
338 - t.datetime "updated_at", :null => false  
339 - t.string "type", :default => "ProjectHook" 337 + t.datetime "created_at", :null => false
  338 + t.datetime "updated_at", :null => false
  339 + t.string "type", :default => "ProjectHook"
340 t.integer "service_id" 340 t.integer "service_id"
  341 + t.boolean "push_events", :default => true, :null => false
  342 + t.boolean "issues_events", :default => false, :null => false
  343 + t.boolean "merge_requests_events", :default => false, :null => false
341 end 344 end
342 345
343 add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" 346 add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"