20181108091549_cleanup_environments_external_url.rb 386 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class CleanupEnvironmentsExternalUrl < ActiveRecord::Migration[4.2]
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    update_column_in_batches(:environments, :external_url, nil) do |table, query|
      query.where(table[:external_url].matches('javascript://%'))
    end
  end

  def down
  end
end