@AntonKhorev commented on this pull request.
> @@ -0,0 +1,14 @@
+class BackfillNoteSubscriptions < ActiveRecord::Migration[7.2]
+ class NoteComment < ApplicationRecord; end
+ class NoteSubscription < ApplicationRecord; end
+
+ disable_ddl_transaction!
+
+ def up
+ NoteComment.in_batches(:of => 1000) do |note_comments|
+ rows = note_comments.distinct.where.not(:author_id =>
nil).pluck(:author_id, :note_id)
+ attrs = %w[user_id note_id]
Moved `attrs = ...` outside, but I don't expect any difference about this
compared to db reads/writes.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5304#discussion_r1833835585
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5304/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev