Repository navigation
[O2B-1515] Preserve updated_at when migrating DESTROYED history items to DONE - #2260
Merged
graduta merged 1 commit intoOct 20, 2026
Merged
Conversation
…s to DONE environments_history_items.updated_at is ON UPDATE CURRENT_TIMESTAMP, so the status conversion reset the historical update time of the converted rows. As the status history and current status are ordered by this column, converted items could end up after later events. Explicitly assign updated_at = updated_at to keep the original value. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2260 +/- ##
==========================================
+ Coverage 46.41% 46.44% +0.03%
==========================================
Files 1053 1053
Lines 17353 17353
Branches 3161 3161
==========================================
+ Hits 8054 8060 +6
+ Misses 9299 9293 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
graduta
deleted the
fix/O2B-1515/preserve-updated-at-in-done-status-migration
branch
October 20, 2026 11:19
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a JIRA ticket
Notable changes for users:
DESTROYEDtoDONEkeep their original history timestamps, so status history and current-status filters give the correct resultsNotable changes for developers:
20261019110000-environment-destroyed-status-to-donenow setsupdated_at = updated_atexplicitlyChanges made to the database:
environments_history_items.updated_atis defined asON UPDATE CURRENT_TIMESTAMP(seev0/20240712100711-environments-milliseconds-timestamps-and-remove-toredown-at.js), so the status conversion reset the historical update time of every converted row.GetAllEnvironmentsUseCaseorders the current status and the status history by this column, so converted entries could be placed after later events and change filter results. The migration now keeps the original value.DESTROYEDrows are alreadyDONEwith a resetupdated_at, and this fix will not repair them (they no longer match theWHERE status = 'DESTROYED'). This is only safe if the migration has not been deployed anywhere yet; otherwise a corrective migration is needed.updated_atto the current time, the new one keeps it.