Add a migration to add a 'usage_last_update' column to the jobs table#30
Merged
Merged
Conversation
…, to be used for tracking when the most recent update was sent to QMS, in avoidance of double-counting
There was a problem hiding this comment.
Pull Request Overview
Adds a timestamp column to track the last usage update for jobs in preparation for the resource-usage-api integration.
- Introduces
usage_last_updatein thejobstable. - Provides a rollback to drop the column if needed.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| migrations/000043_job_usage_last_update.up.sql | Adds usage_last_update column (nullable timestamp) |
| migrations/000043_job_usage_last_update.down.sql | Drops usage_last_update column using DROP IF EXISTS … CASCADE |
Comments suppressed due to low confidence (1)
migrations/000043_job_usage_last_update.down.sql:6
- [nitpick] Using CASCADE on DROP COLUMN may inadvertently remove dependent objects; consider removing CASCADE if there are no dependencies that need to be cascaded.
DROP IF EXISTS usage_last_update CASCADE;
slr71
approved these changes
Jun 2, 2025
slr71
left a comment
Member
There was a problem hiding this comment.
I'm not sure how it managed to escape my attention before now, but it hadn't occurred to me that DROP and ADD were equivalent to DROP COLUMN and ADD COLUMN in ALTER TABLE statements. 😆 Looks good to me! 👍 ![]()
Member
Author
|
Thanks for the review! And yeah, I admittedly mostly copied this from another migration -- I don't think I'd know that either to be honest. |
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.
(to be used for tracking when the most recent update was sent to QMS, in avoidance of double-counting)
This is in advance of resource-usage-api work integrating both this and the metadata field being added to QMS in cyverse/qms#67