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: 52217ce5af2c04de40e233133d09f7406681b915 (plain)
1
2
3
4
5
6
7
# rubocop:disable all
class MigrateRefAndTagToBuild < ActiveRecord::Migration
  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