Skip to content

Commit

Permalink
Refactor raw_prontuario_vitacare__estoque_posicao.sql for primary key…
Browse files Browse the repository at this point in the history
… and foreign key consistency
  • Loading branch information
TanookiVerde committed Oct 11, 2024
1 parent 3f77169 commit 8a1d265
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ with
final as (

select
-- Primary key
-- Primary Key
concat(id_cnes, '.', id, '.', data_particao) as id,
{{
dbt_utils.generate_surrogate_key(
Expand All @@ -58,6 +58,7 @@ with
]
)
}} as id_surrogate,

-- Foreign Keys
safe_cast(area_programatica as string) as area_programatica,
safe_cast(id_cnes as string) as id_cnes,
Expand Down

0 comments on commit 8a1d265

Please sign in to comment.