gitlab-org--gitlab-foss/db/migrate/20181108091549_cleanup_environments_external_url.rb
Cindy Pallares 4bc6f2e3ac
Merge branch 'security-stored-xss-for-environments' into 'master'
[master] Stored XSS for Environments

Closes #2727

See merge request gitlab/gitlabhq!2594
2018-11-28 19:07:29 -05:00

18 lines
381 B
Ruby

# frozen_string_literal: true
class CleanupEnvironmentsExternalUrl < ActiveRecord::Migration
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