Skip to content

Commit

Permalink
Merge pull request opf#17703 from opf/revertible-migration
Browse files Browse the repository at this point in the history
Make migration reversible
  • Loading branch information
NobodysNightmare authored Jan 23, 2025
2 parents 0ecb505 + 0f1fd41 commit 696d92d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#++

class SetDefaultAuthenticationMethod < ActiveRecord::Migration[7.1]
def change
def up
update_sql = <<~SQL.squish
UPDATE storages
SET provider_fields = provider_fields || '{ "authentication_method": "two_way_oauth2" }'::jsonb
Expand All @@ -38,4 +38,9 @@ def change

ActiveRecord::Base.connection.execute(update_sql)
end

def down
# up-direction is backwards-compatible, no need to restrict a migration rollback
# but also nothing to do in case of a rollback
end
end

0 comments on commit 696d92d

Please sign in to comment.