debian-mirror-gitlab/db/migrate/20200214085940_clean_grafana_url.rb

23 lines
368 B
Ruby
Raw Normal View History

2020-03-07 23:17:34 +05:30
# frozen_string_literal: true
2020-03-13 15:44:24 +05:30
class CleanGrafanaUrl < ActiveRecord::Migration[6.0]
2020-03-07 23:17:34 +05:30
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