Closed arnaudiko closed 1 year ago
The session doesn't know which objects the query will delete on the DB, so it has no way to track and update them.
Have you tried providing delete(synchronize_session="fetch")
? That should make so that the session does two queries, one to check which objects will be deleted, and thus update the session, and one to actually delete them. In that case DEPOT might work.
Hi,
Thanks for your feedback I already try to use query.delete(synchronize_session="fetch"). Items are deleted from the database but not from the file system.
Version 0.9.0 should include a fix for this
Hi,
I tried the latest version (0.9.0) but It's still not working
query.delete(synchronize_session='fetch')
self.db.session.flush()
self.db.session.commit()
This code, delete rows in database but not the associated files
I use the SqlAlchemy ORM system. When I get an object and I delete it, the associated file is deleted to.
But when I create query to delete multiple row, row are deleted in the db but the associated files are not deleted