debian-mirror-gitlab/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb
2021-06-08 01:23:25 +05:30

14 lines
375 B
Ruby

# frozen_string_literal: true
class CopyAdoptionSegmentsNamespace < ActiveRecord::Migration[6.0]
def up
execute <<-SQL
UPDATE analytics_devops_adoption_segments SET display_namespace_id = namespace_id
WHERE display_namespace_id IS NULL
SQL
end
def down
execute 'UPDATE analytics_devops_adoption_segments SET display_namespace_id = NULL'
end
end