Unique constraint violation during deployment

0
Hi, I have an attribute set as unique in an entity in domain model however upon deployment to cloud, i get this error:   An error occurred while initializing the Runtime: Detected unique constraint violation [entity: ENTITY, attribute: MobileNumber] Since Mendix 9, only Database Uniqueness Validation is supported. If your project still uses Runtime Uniqueness Validation, please contact support. 2022-06-13T07:29:57.256924 [APP/PROC/WEB/0]  ERROR - M2EE: com.mendix.m2ee.api.AdminException: An error occurred while initializing the Runtime: Detected unique constraint violation [entity: ENTITY, attribute: MobileNumber] Since Mendix 9, only Database Uniqueness Validation is supported. If your project still uses Runtime Uniqueness Validation, please contact support.   There are other entities too with unique validations which were created earlier. however this particular validation throws error while deploying to acceptance. How can we mitigate this?   There are no duplicate records either containing mobile number
asked
3 answers
5

Are you sure there are no duplicate records for the mobile number? This should be the cause of this error. Have you also checked the generalizations and specializations?

 

answered
5

Hi,

Kindly make sure there are not duplication of mobile numbers available. if there are  duplications, then unique validation violation will happen.

Also check the below image for reference

answered
0

I had the same problem this week with a POC running in sandbox. Due to the limitations of the free version, I couldn't see in the logging what was happening.

 

The only way to spot this with a free app is to download a database copy and use it while you run locally. Hopefully this helps someone down the road!

answered