Skip to content

Commit

Permalink
Update the Doorkeeper tokens and grants in batches
Browse files Browse the repository at this point in the history
  • Loading branch information
Dantemss committed Oct 15, 2024
1 parent 4b0085c commit cf40366
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/migrate/20241015172425_set_doorkeeper_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ class SetDoorkeeperScopes < ActiveRecord::Migration[6.1]

def up
change_column_default :oauth_access_grants, :scopes, ''
Doorkeeper::AccessGrant.update_all scopes: 'all'
Doorkeeper::AccessGrant.in_batches.update_all scopes: 'all'
change_column_null :oauth_access_grants, :scopes, false

change_column_default :oauth_access_tokens, :scopes, ''
Doorkeeper::AccessToken.update_all scopes: 'all'
Doorkeeper::AccessToken.in_batches.update_all scopes: 'all'
change_column_null :oauth_access_tokens, :scopes, false
end

def down
change_column_null :oauth_access_tokens, :scopes, true
Doorkeeper::AccessToken.update_all scopes: ''
Doorkeeper::AccessToken.in_batches.update_all scopes: ''
change_column_default :oauth_access_tokens, :scopes, nil

change_column_null :oauth_access_grants, :scopes, true
Doorkeeper::AccessGrant.update_all scopes: ''
Doorkeeper::AccessGrant.in_batches.update_all scopes: ''
change_column_default :oauth_access_grants, :scopes, nil
end
end

0 comments on commit cf40366

Please sign in to comment.