2018-11-28 13:37:12 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-12-12 10:38:40 -05:00
|
|
|
class CleanupEnvironmentsExternalUrl < ActiveRecord::Migration[4.2]
|
2018-11-28 13:37:12 -05:00
|
|
|
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
|