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
|