Id type support on a per-collection basis #5110
Closed
JPrisk
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 4 replies
-
This could be done now with some creativity. Leave the id type alone so the serial IDs are the default. When you need a UUID id type add your own id field: Then with a before change hook on the field you can generate return and return a UUID. It is going to be a varchar field in the db, but functionally it is the same. |
Beta Was this translation helpful? Give feedback.
4 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.
Uh oh!
There was an error while loading. Please reload this page.
-
🙌 great to see the option of
uuid
's get addedfollowing on the back of #3864, it'd be great if users could configure the
idType
on a per-collection basisid
's anduuid
's have slightly different use cases, each offering benefits - it'd be nice to get the best of both worldsthis request might introduce some complexity given
@payloadcms/db-mongodb
doesn't support the newidType
arg, therefore it would need to be conditionally supported in the collection config or coincide with support foridType
for MongoDBopening for consideration 🙏🏼
Beta Was this translation helpful? Give feedback.
All reactions