Closed kaspiana closed 3 months ago
Handling the 'deleted' flag in all potential queries may be tedious. Is there a better way? Perhaps an SQL view like 'extant_documents', for the sake of brevity, though it nevertheless seems clumsy, and I suspect we would need duplicate many queries for documents.
Deleting a document will currently (at least, attempt to) purge all metadata concerning it, with no user confirmation needed. The file is preserved in the
./mage/out
directory, but the metadata is unrecoverable. This is dangerous.Idea 1
Present a confirmation dialog, e.g. 'Are you sure you wish to delete document {id}? Y/N'
Idea 2
The
mage delete doc
command should merely set a 'deleted' status on the document, which will cause it to be excluded from searches. Commands likemage bin clear
andmage bin recover [doc]
can then be used to manage documents marked for deletion.