Closed islean closed 11 months ago
Currently in stage when trying to delete a file with an associated Archive entry:
AssertionError: Dependency rule tried to blank-out primary key column 'archive.file_id' on instance '<Archive at 0x7f6a1cec2b90>'
1d [isak.ohlsson@hasta:~] [S_base] 8s 1 $
In the feature branch:
θ60° 1d [isak.ohlsson@hasta:~] [S_base] $ housekeeper-test delete file 5057208
2023-12-11 15:59:06 hasta.scilifelab.se housekeeper.cli.core[167283] INFO Use root path /home/proj/stage/housekeeper-bundles
Remove file /home/proj/stage/housekeeper-bundles/isaks_test_bundle/2023-12-06/isaks_test_spring_file.spring from file system and database? [y/N]: y
2023-12-11 15:59:22 hasta.scilifelab.se housekeeper.cli.delete[167283] INFO file deleted
θ60° 1d [isak.ohlsson@hasta:~] [S_base] 21s $
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Deployed to stage and production:
Storing signatures
INFO: Creating SIF file...
INFO: Build complete: /home/proj/stage/singularity_containers/housekeeper_temp.sif
Successfully pulled the latest Housekeeper image.
1d [isak.ohlsson@hasta:~] [base] 17s $
Description
When deleting a file entry in Housekeeper, any associated entry in the Archive table (i.e. with a matching file_id) should also be deleted. Currently one can not delete a file when there is an archive entry associated to it. This PR adds that cascade property and adds some tests.
Fixed
Testing
How to prepare for test
Any migrations need to be applied manually with alembic against the stage database.
How to test
Expected test outcome
Review
This version is a: