-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[backend] Account for all relevant pauses in inject start date computation (#2282) #2319
Conversation
5444f43
to
7e8a1c8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release/current #2319 +/- ##
=====================================================
+ Coverage 37.93% 38.08% +0.15%
- Complexity 1778 1782 +4
=====================================================
Files 596 596
Lines 18274 18274
Branches 1214 1214
=====================================================
+ Hits 6932 6960 +28
+ Misses 10984 10956 -28
Partials 358 358 ☔ View full report in Codecov by Sentry. |
statement.execute( | ||
""" | ||
ALTER TABLE exercises ADD COLUMN exercise_pause_date_tempwithtz TIMESTAMP WITH TIME ZONE; | ||
UPDATE exercises SET exercise_pause_date_tempwithtz = exercise_pause_date; | ||
ALTER TABLE exercises DROP COLUMN exercise_pause_date; | ||
ALTER TABLE exercises RENAME COLUMN exercise_pause_date_tempwithtz TO exercise_pause_date; | ||
"""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no migration of existing data (i.e. recompute of timestamps) because I lack information on the relevant timezone that originated the Instant.
But it's not really important as it only affects currently paused simulations and would not impact them further. Assumed TZ after migration is UTC.
ea06e84
to
77f3544
Compare
Signed-off-by: Antoine MAZEAS <[email protected]>
Signed-off-by: Antoine MAZEAS <[email protected]>
77f3544
to
0ce24c3
Compare
Proposed changes
Related issues
Checklist
Further comments
Tests are better implemented with composers hence I propose this PR to release branch. Another PR with just the code fix is going to master.
There's a drive-by fix on the schema because current pause was being persisted assuming the provided instant was local time, when in reality it was provided as UTC => the backend would compute an incorrect UTC time to persist. It was low impact but needed to be addressed.