auto-increment unique fields #1026
Replies: 4 comments 3 replies
-
|
Here's an alternative solution for duplicating documents: #6157 |
Beta Was this translation helpful? Give feedback.
-
|
This has been mostly handled in v3. I rewrote duplicate to be done on the server side and when I did so I added default beforeDuplicate field level hooks for unique fields. This probably makes it not necessary to add a separate flag for the |
Beta Was this translation helpful? Give feedback.
-
|
The duplicate as draft was implemented in this PR. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When duplicating or creating new documents with similar unique fields, it can be difficult for the editor. An enhancement to solve this problem is to add a configuration option on fields that are unique to increment them automatically on the backend, before validation. This would allow a duplicated collection to have a text field for example being saved as
valueto be automatically changed tovalue-1for example, instead of failing with a validation error whenvalueis already present.This could work the same with number field types as well.
The config option:
autoIncrementneeds to be available for field typestextandnumber, only whenuniqueis true.Beta Was this translation helpful? Give feedback.
All reactions