debian-mirror-gitlab/db/migrate/20200214085940_clean_grafana_url.rb
2020-03-13 15:44:24 +05:30

22 lines
368 B
Ruby

# 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