From cf40366d5075912cd7c06e965a1b759032b6d7be Mon Sep 17 00:00:00 2001 From: Dante Soares Date: Tue, 15 Oct 2024 13:45:00 -0500 Subject: [PATCH] Update the Doorkeeper tokens and grants in batches --- db/migrate/20241015172425_set_doorkeeper_scopes.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/migrate/20241015172425_set_doorkeeper_scopes.rb b/db/migrate/20241015172425_set_doorkeeper_scopes.rb index eea863220..99bd50163 100644 --- a/db/migrate/20241015172425_set_doorkeeper_scopes.rb +++ b/db/migrate/20241015172425_set_doorkeeper_scopes.rb @@ -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