Describe the bug
The scheduled job drive.api.files.auto_delete_from_trash fails because it filters Drive File records using a non-existent column named last_modified.
The failing query is generated from apps/drive/drive/api/files.py
def auto_delete_from_trash(): days_before = (date.today() - timedelta(days=30)).isoformat() result = frappe.db.get_all( "Drive File", filters={"is_active": 0, "last_modified": ["<", days_before]}, fields=["name"], ) delete_entities(result)
However, the tabDrive File table does not contain a last_modified column. It contains the standard Frappe modified column and a custom _modified column instead.
This causes the scheduled job to fail with:
MySQLdb.OperationalError: (1054, "Unknown column 'last_modified' in 'WHERE'")
To Reproduce
Allow the scheduled job drive.api.files.auto_delete_from_trash to run, or execute it manually
The scheduled job fails.
Expected behavior
The scheduled job runs
Describe the bug
The scheduled job drive.api.files.auto_delete_from_trash fails because it filters Drive File records using a non-existent column named last_modified.
The failing query is generated from apps/drive/drive/api/files.py
def auto_delete_from_trash(): days_before = (date.today() - timedelta(days=30)).isoformat() result = frappe.db.get_all( "Drive File", filters={"is_active": 0, "last_modified": ["<", days_before]}, fields=["name"], ) delete_entities(result)However, the tabDrive File table does not contain a last_modified column. It contains the standard Frappe modified column and a custom _modified column instead.
This causes the scheduled job to fail with:
MySQLdb.OperationalError: (1054, "Unknown column 'last_modified' in 'WHERE'")
To Reproduce
Allow the scheduled job drive.api.files.auto_delete_from_trash to run, or execute it manually
The scheduled job fails.
Expected behavior
The scheduled job runs