You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support configuring default ID type in generator.yaml #3665
Currently, all generated tables default to using int as the ID type. Once #3659 is merged, it will be possible to override this and use UUID instead.
But the current solution requires a manual override for each model.
Some projects might benefit from using UUIDs as the default value for id types and manual overrides for when int ids are required.
Proposal
Add support for configuring the default ID type at the project level via generator.yaml. This setting should be read by serverpod generate, influencing how IDs are generated for all tables by default.
Example:
idType: uuid
This configuration would instruct the code generator to use uuid as the default type for all new tables unless explicitly overridden.
Use Case
A team building a system with distributed services wants to use UUIDs for better uniqueness guarantees across services. They can configure this once in generator.yaml, ensuring consistency across all table definitions without manual overrides.
Alternatives
Continue requiring per-table ID type overrides (status quo)
Additional context
This configuration should apply per module.
How experienced are you with this library?
Expert - Experienced and comfortable with using this library in complex projects
Activity