generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backfill the
significantly_updated_at
from updated_at
We want to backfill the `significantly_updated_at` using the `updated_at` attribute of each user.
- Loading branch information
1 parent
de465d7
commit ec39f08
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
db/migrate/20241122155145_backfill_significantly_updated_at.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class BackfillSignificantlyUpdatedAt < ActiveRecord::Migration[7.1] | ||
def up | ||
User.in_batches do |batch| | ||
batch.update_all("significantly_updated_at = updated_at") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters