是否可以通过 API 或应用程序硬删除 Directus 项目?
Is it possible to hard delete a Directus item through the API or app?
通过 UI 或 API 从具有状态字段的集合中删除项目会导致项目被软删除。但是,在这一特定实例中,我们希望将其从数据库中完全删除。
如果不可能,是否可以通过数据库将其从带有集合名称的 table 中删除来安全地完成?这样做有什么副作用吗?
在本页找到答案https://v8.docs.directus.io/guides/status.html#soft-delete:
When deleting an item, the API does the following:
Check if the collection has a status field
Check if the delta data has the status field (meaning the status was changed)
Check if the new status value (from delta data) has soft_delete = true
If yes, it sets the action to SOFT_DELETE
If no, it hard deletes the item (permanently removed from the database)
通过 UI 或 API 从具有状态字段的集合中删除项目会导致项目被软删除。但是,在这一特定实例中,我们希望将其从数据库中完全删除。
如果不可能,是否可以通过数据库将其从带有集合名称的 table 中删除来安全地完成?这样做有什么副作用吗?
在本页找到答案https://v8.docs.directus.io/guides/status.html#soft-delete:
When deleting an item, the API does the following:
Check if the collection has a status field
Check if the delta data has the status field (meaning the status was changed)
Check if the new status value (from delta data) has soft_delete = true
If yes, it sets the action to SOFT_DELETE
If no, it hard deletes the item (permanently removed from the database)