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

20151002122943_migrate_ref_and_tag_to_build.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4038e6fa8337e187253cd14c9b453dc32d6ca04 (plain)
1
2
3
4
5
6
7
# rubocop:disable all
class MigrateRefAndTagToBuild < ActiveRecord::Migration[4.2]
  def change
    execute('UPDATE ci_builds SET ref=(SELECT ref FROM ci_commits WHERE ci_commits.id = ci_builds.commit_id) WHERE ref IS NULL')
    execute('UPDATE ci_builds SET tag=(SELECT tag FROM ci_commits WHERE ci_commits.id = ci_builds.commit_id) WHERE tag IS NULL')
  end
end