Skip to content

Commit

Permalink
chore: set response_received_at to created_at in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jul 17, 2024
1 parent af90775 commit 1c7205f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ var _202407171220_add_response_received_at_to_request_events = &gormigrate.Migra

// Update response_received_at if there is a corresponding row in response_events
if err := tx.Exec(`
UPDATE request_events re
SET response_received_at = (SELECT created_at FROM response_events WHERE request_id = re.id)
WHERE id IN (SELECT request_id FROM response_events WHERE request_id IS NOT NULL)
UPDATE request_events SET response_received_at = created_at
`).Error; err != nil {
return err
}
Expand Down

0 comments on commit 1c7205f

Please sign in to comment.