From e4c23edb7164105966806a19a867df16a638ec30 Mon Sep 17 00:00:00 2001 From: PSNAppZ Date: Thu, 28 Nov 2024 11:42:48 +0530 Subject: [PATCH] add registrant_id_uniq constraint --- g2p_social_registry/models/g2p_que_id_generation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/g2p_social_registry/models/g2p_que_id_generation.py b/g2p_social_registry/models/g2p_que_id_generation.py index c1ad43d..c8373aa 100644 --- a/g2p_social_registry/models/g2p_que_id_generation.py +++ b/g2p_social_registry/models/g2p_que_id_generation.py @@ -9,7 +9,6 @@ class G2PQueIDGeneration(models.Model): registrant_id = fields.Char( string="Registrant ID", required=True, - unique=True, ) id_generation_request_status = fields.Selection( @@ -68,3 +67,6 @@ class G2PQueIDGeneration(models.Model): string="Last Attempt Datetime (Update)" ) + _sql_constraints = [ + ("registrant_id_uniq", "UNIQUE(registrant_id)", "registrant_id is an unique identifier!"), + ]