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>
This commit is contained in:
Dmitriy Zaporozhets 2013-12-02 21:33:43 +02:00
parent 88bab75aa4
commit 169b4ce0ca
2 changed files with 14 additions and 4 deletions

View file

@ -0,0 +1,7 @@
class AddEventFieldsForWebHook < ActiveRecord::Migration
def change
add_column :web_hooks, :push_events, :boolean, default: true, null: false
add_column :web_hooks, :issues_events, :boolean, default: false, null: false
add_column :web_hooks, :merge_requests_events, :boolean, default: false, null: false
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20131112220935) do
ActiveRecord::Schema.define(:version => 20131202192556) do
create_table "broadcast_messages", :force => true do |t|
t.text "message", :null => false
@ -338,6 +338,9 @@ ActiveRecord::Schema.define(:version => 20131112220935) do
t.datetime "updated_at", :null => false
t.string "type", :default => "ProjectHook"
t.integer "service_id"
t.boolean "push_events", :default => true, :null => false
t.boolean "issues_events", :default => false, :null => false
t.boolean "merge_requests_events", :default => false, :null => false
end
add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"