-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Note: this is not a bug but an suggestion query
In tracim, we manage file uploads using depot. It works very well actaully.
For some reasons, we try to work with a database which has not the file system part of data, so depot is broken - and it's expected.
What we try to do is to clean the database according to missing files.
Example of what I mean:
for user_file in session.query(UserFile):
if user_file.uploaded_content.depot.is_invalid():
session.delete(userf_file)
Unfortunately the query fails because depot fails (because it can't find files on file system) .
What is the right way to manage this case? What I expect is to be able to get the depot file uuid without to try loading data from files then manually check file existence, but it requires to write raw SQL or to use another model mapping.
Maybe there is a more clever solution?
cc @Skylsmoi
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels