-
Notifications
You must be signed in to change notification settings - Fork 21
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
[BIOMAGE-1836] Implement metadata tracks-specific endpoints #343
Conversation
Codecov Report
@@ Coverage Diff @@
## master #343 +/- ##
==========================================
+ Coverage 85.03% 85.24% +0.20%
==========================================
Files 135 137 +2
Lines 3622 3679 +57
Branches 401 405 +4
==========================================
+ Hits 3080 3136 +56
- Misses 499 500 +1
Partials 43 43
Continue to review full report at Codecov.
|
@@ -52,7 +52,7 @@ const deleteSample = async (req, res) => { | |||
logger.log(`Deleting sample ${sampleId} from experiment ${experimentId}`); | |||
|
|||
await sqlClient.get().transaction(async (trx) => { | |||
await new Sample(trx).destroy(sampleId); | |||
await new Sample(trx).delete(sampleId); |
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.
Will the metadata track entries, if any, be deleted when we call Sample.delete
in line 55?
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.
No, we tlaked about this with agi yesterday actually, you can test the current behavior in apj v1, if you remove all samples and add a new one after the metadata tracks will still be there.
(The sample_in_metadata_track_map
rows will be auto deleted).
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.
I didn't know this about v1. How do sample_in_metadata_track_map
get auto deleted? Is there a trigger?
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.
it's the result of th eforeign keys set up.
If you write ON DELETETE CASCADE you're saying that when the foreign key a row is referencing is deleted then its own action should be to also be deleted.
…ete so that they match better the naming patterns of other BasicModel functions
Description
Details
URL to issue
https://biomage.atlassian.net/browse/BIOMAGE-1836
Link to staging deployment URL (or set N/A)
https://ui-martinfosco-ui699-api343.scp-staging.biomage.net/
Links to any PRs or resources related to this PR
hms-dbmi-cellenics/ui#699
Integration test branch
master
Merge checklist
Your changes will be ready for merging after all of the steps below have been completed.
Code updates
Have best practices and ongoing refactors being observed in this PR
Manual/unit testing
Integration testing
You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.
Documentation updates
Optional