Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20151209144329_migrate_ci_web_hooks.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0293be3f6ce27a6ebdbe04ff918803b7d2f90be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class MigrateCiWebHooks < ActiveRecord::Migration
  include Gitlab::Database

  def up
    execute(
      'INSERT INTO web_hooks (url, project_id, type, created_at, updated_at, push_events, build_events) ' \
      "SELECT ci_web_hooks.url, projects.id, 'ProjectHook', ci_web_hooks.created_at, ci_web_hooks.updated_at, #{false_value}, #{true_value} FROM ci_web_hooks " \
      'JOIN ci_projects ON ci_web_hooks.project_id = ci_projects.id ' \
      'JOIN projects ON ci_projects.gitlab_id = projects.id'
    )
  end
end