BigW Consortium Gitlab

20151209144329_migrate_ci_web_hooks.rb 720 Bytes
Newer Older
1
# rubocop:disable all
2
class MigrateCiWebHooks < ActiveRecord::Migration
3
  include Gitlab::Database::MigrationHelpers
4 5 6

  def up
    execute(
7 8 9
      '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 " \
10 11 12 13
      'JOIN ci_projects ON ci_web_hooks.project_id = ci_projects.id ' \
      'JOIN projects ON ci_projects.gitlab_id = projects.id'
    )
  end
14 15 16

  def down
  end
17
end