2018-12-23 12:14:25 +05:30
|
|
|
class MigrateProjectIdForCiCommits < ActiveRecord::Migration[4.2]
|
2015-10-24 18:46:33 +05:30
|
|
|
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
|