| 21 | | |
| | 21 | select u.email, u.username, u.full_name, u.profile_picture, u.type, |
| | 22 | coalesce (a.*) as artist, |
| | 23 | coalesce (o.*) as organizer, |
| | 24 | coalesce (m.*) as manager |
| | 25 | from project.users u |
| | 26 | left join artists a |
| | 27 | on u.id = a.user_id |
| | 28 | and u."type" = 'ARTIST'::project."user_type" |
| | 29 | left join organizers o |
| | 30 | on u.id = o.user_id |
| | 31 | and u."type" = 'ORGANIZER'::project."user_type" |
| | 32 | left join managers m |
| | 33 | on u.id = m.user_id |
| | 34 | and u."type" = 'MANAGER'::project."user_type" |
| | 35 | where |
| | 36 | u.email = 'test_artist@mail.com' |
| | 37 | and u.password = 'password'; |