BigW Consortium Gitlab

20150924125436_migrate_project_id_for_ci_commits.rb 291 Bytes
Newer Older
1
# rubocop:disable all
Kamil Trzcinski committed
2 3
class MigrateProjectIdForCiCommits < ActiveRecord::Migration
  def up
Kamil Trzcinski committed
4 5
    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")
Kamil Trzcinski committed
6 7
  end
end