Object Deletion
Open Register implements a soft deletion strategy for objects, ensuring data can be recovered and maintaining referential integrity.
Overview
The deletion system provides:
- Soft deletion of objects
- Retention of relationships
- Configurable retention periods
- Recovery capabilities
- Audit trail preservation
Deletion Metadata
When an object is deleted, the following metadata is stored:
Field | Type | Description |
---|---|---|
deleted | datetime | When the object was marked as deleted |
deletedBy | string | User ID who performed the deletion |
deletedReason | string | Optional reason for deletion |
retentionPeriod | integer | How long to keep the deleted object (in days) |
purgeDate | datetime | When the object will be permanently deleted |
Deletion States
Objects can exist in the following states:
- Active (deleted = null)
- Soft Deleted (deleted = timestamp)
- Pending Purge (current date > purgeDate)
- Purged (permanently deleted)
Deletion Logic
- Objects are never immediately deleted from the database
- Deletion sets the 'deleted' timestamp and related metadata
- Deleted objects are excluded from normal queries
- Relations to deleted objects are preserved
- Files linked to deleted objects are moved to a trash folder
- Deleted objects can be restored until purge date
- Objects are only permanently deleted after retention period
Key Benefits
Data Safety
- Prevent accidental data loss
- Maintain data relationships
- Support data recovery
- Preserve audit history
Compliance
- Meet retention requirements
- Support legal holds
- Track deletion reasons
- Document deletion process
Management
- Flexible retention policies
- Controlled purge process
- Recovery options
- Clean data lifecycle
Related Features
- Audit Trails - Track deletion operations
- Object Locking - Prevent deletions of locked objects
- Access Control - Manage deletion permissions
- Time Travel - View objects at points before deletion