Skip to content

Commit

Permalink
Merge pull request #85 from Opetushallitus/OK-602__pub-kerroksen-korj…
Browse files Browse the repository at this point in the history
…auksia

Ok 602  pub kerroksen korjauksia
  • Loading branch information
razze76 authored Jan 3, 2025
2 parents fceb6b4 + e27fb40 commit 6ad8e3d
Show file tree
Hide file tree
Showing 40 changed files with 114 additions and 40 deletions.
2 changes: 1 addition & 1 deletion dbt/models/dw/dw_ataru_hakemus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with raw as (
row_number() over (partition by oid, versio_id, muokattu order by dw_metadata_dbt_copied_at desc) as _row_nr
from {{ ref('stg_ataru_hakemus') }}
{% if is_incremental() %}
where dw_metadata_dbt_copied_at > (select max(dw_metadata_dbt_copied_at) from {{ this }})
where dw_metadata_dbt_copied_at > (select max(t.dw_metadata_dbt_copied_at) from {{ this }} as t)
{% endif %}
)

Expand Down
2 changes: 1 addition & 1 deletion dbt/models/dw/dw_ataru_lomake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with raw as (
row_number() over (partition by id, versio_id, muokattu order by dw_metadata_dbt_copied_at desc) as _row_nr
from {{ ref('stg_ataru_lomake') }}
{% if is_incremental() %}
where dw_metadata_dbt_copied_at > (select max(dw_metadata_dw_stored_at) from {{ this }})
where dw_metadata_dbt_copied_at > (select max(t.dw_metadata_dw_stored_at) from {{ this }} as t)
{% endif %}
),

Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_ataru_hakemus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_ataru_lomake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ with source as (
select * from {{ source('ovara', 'ataru_lomake') }}

{% if is_incremental() %}
where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)
{% endif %}
),

Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_hakukohderyhmapalvelu_ryhma.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_ammattinimike.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_asiasana.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_haku.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_hakukohde.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_koulutus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_oppilaitoksetjaosat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_pistehistoria.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as ( --noqa: PRS

{%- if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif -%}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_sorakuvaus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_toteutus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_kouta_valintaperuste.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_ohjausparametrit_parameter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_arvosana.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_ensikertalainen.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_harkinnanvaraisuus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_opiskelija.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_opiskeluoikeus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_proxysuoritus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_sure_suoritus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ with source as (
select * from {{ source('ovara', 'valintalaskenta_valintalaskennan_tulos') }}
{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}

Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintaperusteet_hakukohde.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintapiste_service_pistetieto.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ with source as ( --noqa: PRS

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintarekisteri_ilmoittautuminen.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintarekisteri_valinnantulos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintarekisteri_valintatapajono.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/stg_valintarekisteri_vastaanotto.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/yleiskayttoiset/stg_koodisto_koodi.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/yleiskayttoiset/stg_koodisto_relaatio.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/yleiskayttoiset/stg_onr_henkilo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
4 changes: 3 additions & 1 deletion dbt/models/stg/yleiskayttoiset/stg_onr_yhteystieto.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ with source as (

{% if is_incremental() %}

where dw_metadata_dbt_copied_at > (select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }})
where dw_metadata_dbt_copied_at > (
select coalesce(max(dw_metadata_dbt_copied_at), '1899-12-31') from {{ this }}
)

{% endif %}

Expand Down
Loading

0 comments on commit 6ad8e3d

Please sign in to comment.