Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/5106'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 23, 2024
2 parents ec5754a + 3bba84e commit fba6f95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class BackfillDeactivatesAtInUserBlocks < ActiveRecord::Migration[7.1]
class UserBlock < ApplicationRecord; end

disable_ddl_transaction!

def up
UserBlock.where(:needs_view => false, :deactivates_at => nil).in_batches do |relation|
relation.update_all("deactivates_at = GREATEST(ends_at, updated_at)")
end
end
end
1 change: 1 addition & 0 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('23'),
('22'),
('21'),
('20240822121603'),
('20240813070506'),
('20240618193051'),
('20240605134916'),
Expand Down

0 comments on commit fba6f95

Please sign in to comment.