Could the Duplicate Entry error, be sent back in the web request?

Just enabled unique fields on some of my fields, and I realise now that it ‘fails nicely’ but it just returns a 500, I don’t really want to capture all 500 errors and log them as duplicates.

I dont know if this is even possible, just when im inspecting the response from Strapi, after a duplicate has been attempted, I cant see a verbose message anywhere, but it is there in the Strapi logs, as Error: ER_DUP_ENTRY: Duplicate entry so wondered if it was possible?

Thanks!

Our validations should be catching this, what Strapi version are you on?

1 Like

Test with @kieron via slack and confirmed it’s a bug:

https://github.com/strapi/strapi/issues/8664

1 Like

In my Case I used MySQL DB and I fixed this issue droping the duplicated column. Well I know that is not the best practice but work for me. Do you know If I will have problems in the future?

At the moment @Carlos_Abanto you were on the right track. We know the lack of migrations is a pain point and will be addressing it shortly in Q1/Q2 2021.

Strapi can create new tables/columns (along with certain constraints) but won’t delete any tables or columns, which if you are deleting and re-adding a field with the same name could cause some conflicts.