gitlab-org--gitlab-foss/db/migrate/20200214085940_clean_grafana_url.rb

23 lines
368 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class CleanGrafanaUrl < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
execute(
<<-SQL
UPDATE
application_settings
SET
grafana_url = default
WHERE
position('javascript:' IN btrim(application_settings.grafana_url)) = 1
SQL
)
end
def down
# no-op
end
end