Update queries to use the new name of the record EDTF column#784
Conversation
We are renaming record.originalfilecreationtime to record.displaytime, which better reflects its actual meaning. In light of that, this commit updates all stela queries that touch that column to use the new name.
|
This requires https://github.com/PermanentOrg/back-end/pull/888 (which is why the tests fail) |
There was a problem hiding this comment.
Pull request overview
This PR updates Stela’s SQL queries and related tests/fixtures to reflect a database column rename on record from originalfilecreationtime to displaytime (EDTF “display time”), aligning the column name with its intended meaning.
Changes:
- Updated record update/select SQL to reference
record.displaytimeinstead ofrecord.originalfilecreationtime. - Updated record-copy and record fixture SQL to insert/select
displaytime. - Updated Jest tests in
@stela/apiand@stela/metadata_attacherto query/assert againstdisplayTime/displaytime.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/metadata_attacher/src/queries/update_metadata.sql | Updates the metadata attacher’s record UPDATE to set displaytime. |
| packages/metadata_attacher/src/index.test.ts | Updates test query shape and assertions to use displayTime. |
| packages/api/src/record/queries/update_record.sql | Renames the updated column in the record PATCH query to displaytime. |
| packages/api/src/record/queries/get_records.sql | Renames selected column to record.displaytime AS "displayTime". |
| packages/api/src/record/queries/copy_record.sql | Copies displaytime when duplicating a record. |
| packages/api/src/record/fixtures/create_complete_test_record.sql | Updates test fixture insert column list to displaytime. |
| packages/api/src/record/controller/update_record.test.ts | Updates test DB assertions to select/expect displaytime. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #784 +/- ##
=======================================
Coverage 98.56% 98.56%
=======================================
Files 109 109
Lines 2778 2778
Branches 464 464
=======================================
Hits 2738 2738
Misses 36 36
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
We are renaming record.originalfilecreationtime to record.displaytime, which better reflects its actual meaning. In light of that, this commit updates all stela queries that touch that column to use the new name.