parent
acf57e4ae2
commit
7d35386ece
@ -1,5 +1,13 @@ |
||||
class BackfillTimeEntriesWithLoggedById < ActiveRecord::Migration[7.0] |
||||
def change |
||||
def up |
||||
TimeEntry |
||||
.where.not(user_id: User.select(:id)) |
||||
.update_all(user_id: DeletedUser.first.id) |
||||
|
||||
TimeEntry.all.update_all('logged_by_id = user_id') |
||||
end |
||||
|
||||
def down |
||||
# Nothing to do |
||||
end |
||||
end |
||||
|
Loading…
Reference in new issue