Thanks for building Strapi <3 and adding the long-awaited localization feature.
This doesn’t make a lot of sense to me. Uniques should be the same across all locales, technically (coming from RDBMS background) this can be implemented as a unique constraint on two columns.
For those looking for a hack, I’m providing this sample from one of my products. On PostgreSQL I did the following to fix this on the database level:
alter table products
drop constraint "products_SKU_unique"; // this query deletes the constraint created automatically by strapi
alter table products add constraint unique_sku_per_locale
unique ("SKU", locale); // this one creates a new unique constraint on two columns
Please note that I didn’t test this on production yet and it might cause problems, so please make sure you know what you’re doing.
this way, SKU will only be required to be unique in one locale.
@soupette please consider rethinking this design,
Thanks!