Merged PR 2516: Create host_user and user_role in intermediate

# Description

Adds 2 new tables:
- `int_core__user_role`: contains the relationship of a given user has a role.
- `int_core__user_host`: based on the previous table, it selects the users and main information from those users that are considered as hosts according to the role they have.

Note: I needed to change the test in stg. A user, generally, can have no role, one role, or multiple roles. Thus we cannot propagate this information in the unified_user model.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [X] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #19513
This commit is contained in:
Oriol Roqué Paniagua 2024-08-07 14:28:34 +00:00
parent ad7d94b604
commit 7177b41e19
4 changed files with 165 additions and 3 deletions

View file

@ -150,9 +150,7 @@ models:
columns:
- name: id_role
tests:
- unique
- not_null
- name: id_user
tests:
- unique
- not_null