Support unique: true on Enumeration Fields in Content-Type Schema
Abhijit Barick
Problem
Currently, Strapi allows unique: true on text, email, and other scalar fields, but does not support unique: true on enumeration fields — either in the Content-Type Builder UI or through the schema.json.
Even if "unique": true is manually added to an enum field in schema.json, Strapi:
Does not validate uniqueness on API requests
Does not apply a UNIQUE constraint in the database
Does not warn or block duplicate enum values during creation or update
This results in false confidence that uniqueness is being enforced when it actually isn't.
Use Case
In configuration or singleton-like collections, it's often necessary to ensure that a specific enum value (e.g., city: "bangalore") exists only once across all entries. Without native support, users must:
Add custom lifecycle hooks to enforce uniqueness
github issue link: https://github.com/strapi/strapi/issues/23912