From a10be9aca5b5d4b0b77f0419834e5f335d180854 Mon Sep 17 00:00:00 2001 From: erick.sato Date: Thu, 19 May 2016 16:15:22 -0300 Subject: [PATCH] [Redmine #4698]Restrição grupo usuário duplicar --- cit-portal-api/src/main/resources/scripts-bd/postgres/v2.3.0/01-cit-portal-2.3.0-postgres.sql | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) create mode 100644 cit-portal-api/src/main/resources/scripts-bd/postgres/v2.3.0/01-cit-portal-2.3.0-postgres.sql diff --git a/cit-portal-api/src/main/resources/scripts-bd/postgres/v2.3.0/01-cit-portal-2.3.0-postgres.sql b/cit-portal-api/src/main/resources/scripts-bd/postgres/v2.3.0/01-cit-portal-2.3.0-postgres.sql new file mode 100644 index 0000000..8583d50 --- /dev/null +++ b/cit-portal-api/src/main/resources/scripts-bd/postgres/v2.3.0/01-cit-portal-2.3.0-postgres.sql @@ -0,0 +1,4 @@ +-- Erick INICIO 19/05/2016 + DELETE FROM grupousuario WHERE grupousuario.ctid NOT IN (SELECT MIN(grupousuario.ctid) FROM grupousuario GROUP BY grupo_id, usuario_id); + ALTER TABLE grupousuario ADD CONSTRAINT grupousuario_unico UNIQUE (grupo_id, usuario_id); +-- Erick FIM 19/05/2016 \ No newline at end of file -- libgit2 0.21.2