The feature request is to enhance the soft delete functionality by allowing the specification of a delId field. This field would be set to the value of the id field (or another unique identifier) instead of using the creation time when marking a record as deleted. This approach aims to provide a unique and consistent reference for each deleted record, reducing the risk of conflicts or ambiguities that may arise when relying on timestamps.
Motivation
The motivation behind this feature is to address potential conflicts and ambiguities in systems that utilize soft deletes. By using the id field, which is inherently unique, as the value for the delId field, we can ensure that each deletion operation is traceable and distinct. This can be particularly beneficial in systems with high concurrency or those that require precise audit trails. Additionally, using the id field helps in maintaining referential integrity and simplifying queries that involve deleted records.
Describe the feature
The feature request is to enhance the soft delete functionality by allowing the specification of a delId field. This field would be set to the value of the id field (or another unique identifier) instead of using the creation time when marking a record as deleted. This approach aims to provide a unique and consistent reference for each deleted record, reducing the risk of conflicts or ambiguities that may arise when relying on timestamps.
Motivation
The motivation behind this feature is to address potential conflicts and ambiguities in systems that utilize soft deletes. By using the id field, which is inherently unique, as the value for the delId field, we can ensure that each deletion operation is traceable and distinct. This can be particularly beneficial in systems with high concurrency or those that require precise audit trails. Additionally, using the id field helps in maintaining referential integrity and simplifying queries that involve deleted records.
Related Issues
https://github.com/go-gorm/gorm/issues/4047