From fdb52731fa75bf0691eccd576390fd14c3c5d006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Mon, 10 Aug 2020 08:44:19 +0200 Subject: [PATCH] feature/Tweak db view v_auth_user --- obp-api/src/main/scripts/sql/cre_views.sql | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scripts/sql/cre_views.sql b/obp-api/src/main/scripts/sql/cre_views.sql index dbf45eea6..ffe924182 100644 --- a/obp-api/src/main/scripts/sql/cre_views.sql +++ b/obp-api/src/main/scripts/sql/cre_views.sql @@ -3,8 +3,33 @@ drop view v_resource_user cascade; create or replace view v_resource_user as select userid_ resource_user_id, name_ username, email, id numeric_resource_user_id, provider_ provider, providerid provider_id from resourceuser; drop view v_auth_user cascade; -create or replace view v_auth_user as select username, firstname, lastname, email, uniqueid auth_user_id, id numeric_auth_user_id, user_c, validated from authuser; - +create view v_auth_user as +select + username, + firstname, + lastname, + email, + uniqueid auth_user_id, + id numeric_auth_user_id, + user_c, + validated +from + authuser +union +select + null username, + null firstname, + null lastname, + null email, + null auth_user_id, + null numeric_auth_user_id, + null user_c, + null validated +from + authuser +where + 1 = 0; + drop view v_auth_user_resource_user cascade; create or replace view v_auth_user_resource_user as select au.username from v_auth_user au, v_resource_user ru where au.numeric_auth_user_id = ru.numeric_resource_user_id;