-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate archived_at field on devices for archived devices
This corrects an oversight in my previous PR which created the field but didn't set it for previously-archived devices.
- Loading branch information
1 parent
6c768e3
commit 8c45768
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
db/migrate/20230705095430_populate_device_archived_at_column.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,9 @@ | ||
class PopulateDeviceArchivedAtColumn < ActiveRecord::Migration[6.0] | ||
def change | ||
execute %{ | ||
UPDATE devices | ||
SET archived_at = NOW() | ||
WHERE workflow_state = 'archived' | ||
} | ||
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