auto-increment unique fields #1026
DanRibbens
announced in
Roadmap
Replies: 3 comments 3 replies
-
Here's an alternative solution for duplicating documents: #6157 |
Beta Was this translation helpful? Give feedback.
0 replies
-
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.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
value
to be automatically changed tovalue-1
for example, instead of failing with a validation error whenvalue
is already present.This could work the same with number field types as well.
The config option:
autoIncrement
needs to be available for field typestext
andnumber
, only whenunique
is true.Beta Was this translation helpful? Give feedback.
All reactions