2015-12-09 15:31:42 +00:00
|
|
|
class MigrateCiWebHooks < ActiveRecord::Migration
|
2017-04-10 10:23:28 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
2015-12-09 15:31:42 +00:00
|
|
|
|
|
|
|
def up
|
|
|
|
execute(
|
2015-12-14 10:04:47 +00:00
|
|
|
'INSERT INTO web_hooks (url, project_id, type, created_at, updated_at, push_events, issues_events, merge_requests_events, tag_push_events, note_events, build_events) ' \
|
|
|
|
"SELECT ci_web_hooks.url, projects.id, 'ProjectHook', ci_web_hooks.created_at, ci_web_hooks.updated_at, " \
|
|
|
|
"#{false_value}, #{false_value}, #{false_value}, #{false_value}, #{false_value}, #{true_value} FROM ci_web_hooks " \
|
2015-12-09 15:31:42 +00:00
|
|
|
'JOIN ci_projects ON ci_web_hooks.project_id = ci_projects.id ' \
|
|
|
|
'JOIN projects ON ci_projects.gitlab_id = projects.id'
|
|
|
|
)
|
|
|
|
end
|
2015-12-23 18:39:44 +00:00
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
2015-12-09 15:31:42 +00:00
|
|
|
end
|