Migrate set existing Geo OAuth applications to trusted

parent 3a44f9d2
# frozen_string_literal: true
class MakeTheGeoOauthApplicationTrustedByDefault < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
execute(<<-SQL.squish)
UPDATE oauth_applications
SET confidential = true, trusted = true
WHERE id IN (SELECT oauth_application_id FROM geo_nodes);
SQL
end
def down
# We won't be able to tell which trusted applications weren't
# confidential before the migration and setting all trusted
# applications are not confidential would introduce security
# issues.
end
end
233a976aab340f16ed1c896963580fb66f4c9b4dee6a34f9536a62a4f7688792
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment