rails 6: update_all doesn't accept AR objects anymore

Change-Id: Ie8739b0b168dd1ee485f34637656e516ce3c16b0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256441
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2021-01-11 10:27:34 -07:00
parent 18176c1f73
commit e5aec36e36
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class AddReplicaIdentityForDeveloperKeys < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def up
until DeveloperKey.where(root_account_id: nil, account_id: nil).limit(1_000).update_all(root_account_id: Account.site_admin) < 1_000; end
until DeveloperKey.where(root_account_id: nil, account_id: nil).limit(1_000).update_all(root_account_id: Account.site_admin.id) < 1_000; end
add_replica_identity 'DeveloperKey', :root_account_id, 0
remove_index :developer_keys, name: 'index_developer_keys_on_root_account_id', if_exists: true
end