extends delete system logic
This commit is contained in:
@@ -323,21 +323,44 @@ class DocumentController extends AbstractController
|
||||
@unlink((string)$params->get('mto.knowledge.index_meta'));
|
||||
@unlink((string)$params->get('mto.runtime.meta'));
|
||||
|
||||
@unlink((string)$params->get('mto.knowledge.tags_ndjson'));
|
||||
@unlink((string)$params->get('mto.knowledge.vector_tags_index'));
|
||||
@unlink((string)$params->get('mto.knowledge.vector_tags_index_meta'));
|
||||
|
||||
$uploadDir = (string)$params->get('mto.knowledge.upload');
|
||||
if ($uploadDir !== '' && is_dir($uploadDir)) {
|
||||
exec('rm -rf ' . escapeshellarg($uploadDir));
|
||||
}
|
||||
|
||||
$lockDir = (string)$params->get('mto.locks.dir');
|
||||
if ($lockDir !== '' && is_dir($lockDir)) {
|
||||
exec('rm -rf ' . escapeshellarg($lockDir));
|
||||
}
|
||||
|
||||
$sql = '
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.document;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.document_version;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.ingest_job;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.knowledge_tag;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.tag_rebuild_job;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
TRUNCATE TABLE db.document_tag;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
';
|
||||
$connection->executeQuery($sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user