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

20150924125436_migrate_project_id_for_ci_commits.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fb0e0ba1fa54d8341258a3ab22ac71981ef57fa2 (plain)
1
2
3
4
5
6
7
# rubocop:disable all
class MigrateProjectIdForCiCommits < ActiveRecord::Migration
  def up
    subquery = 'SELECT gitlab_id FROM ci_projects WHERE ci_projects.id = ci_commits.project_id'
    execute("UPDATE ci_commits SET gl_project_id=(#{subquery}) WHERE gl_project_id IS NULL")
  end
end