{"id":1920,"date":"2020-10-30T10:20:41","date_gmt":"2020-10-30T10:20:41","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/performance\/the-uniqueness-validation-should-be-set-to-database\/"},"modified":"2020-10-30T10:22:10","modified_gmt":"2020-10-30T10:22:10","slug":"projectperformanceuniquenessvalidation","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/projectperformanceuniquenessvalidation","title":{"rendered":"The Uniqueness Validation should be set to Database"},"content":{"rendered":"\n<p>Introduced in version 2.1 (Released November 3rd)<\/p>\n\n\n\n<p>From Mendix version 7.1.0, Mendix recommends setting the uniqueness validation to <strong>Database<\/strong> in the <em>Project Runtime Settings<\/em>, to prepare your app for future versions of Mendix, in which this setting will be the default.<\/p>\n\n\n\n<p>Mendix shares: \u201cThe effect\nof selecting Database is that when you deploy a model with unique validation\nrules on attributes (existing rules or new rules), all the existing objects for\nthe affected entity will be checked for the uniqueness of the attribute.\u201d<\/p>\n\n\n\n<p>Read more about<em> <a rel=\"noreferrer noopener\" aria-label=\"the uniqueness validation constraint (opens in a new tab)\" href=\"https:\/\/docs.mendix.com\/refguide\/uniqueness-constraint-migration\" target=\"_blank\">the uniqueness validation constraint<\/a><\/em> in the Mendix documentation.<\/p>\n\n\n\n<p><strong>Non-compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-8.png\" alt=\"\" class=\"wp-image-1899\"\/><figcaption>Against Mendix&#8217; recommendation, the uniqueness validation is set to <em>Runtime.<\/em><\/figcaption><\/figure>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/10\/image-7.png\" alt=\"\" class=\"wp-image-1898\"\/><\/figure>\n\n\n\n<p>In Mendix 8 projects, open the <em>Project Settings<\/em>, go to <span style=\"text-decoration: underline;\">Runtime<\/span>, and set the <em>Uniqueness validation<\/em> to <strong>Database<\/strong><em>.<\/em><\/p>\n","protected":false},"featured_media":0,"parent":95,"menu_order":28,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1920","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1920"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1920"}],"version-history":[{"count":1,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1920\/revisions"}],"predecessor-version":[{"id":1921,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1920\/revisions\/1921"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/95"}],"prev":[{"title":"Persistent entities should have indices","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/performanceminamountindices","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1485"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1920"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}