-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populer noen felter inn i oppgavefelt_verdi_aktiv (steg 2) (#2814)
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/resources/migreringer/V1.0_0072__oppgavefeltverdi_aktiv_denormaliser_populer.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
with fasit as (select ov.id as f_id, | ||
fd.ekstern_id as f_fd_ekstern_id, | ||
o.ekstern_id as f_omr_ekstern_id, | ||
ot.ekstern_id as f_ot_ekstern_id | ||
from oppgavefelt_verdi_aktiv ov | ||
inner join oppgave_v3_aktiv oa on ov.oppgave_id = oa.id | ||
inner join oppgavefelt f on ov.oppgavefelt_id = f.id | ||
inner join feltdefinisjon fd on f.feltdefinisjon_id = fd.id | ||
inner join omrade o on fd.omrade_id = o.id | ||
inner join oppgavetype ot on ot.id = oa.oppgavetype_id | ||
where ov.omrade_ekstern_id is null) | ||
update oppgavefelt_verdi_aktiv ova | ||
set omrade_ekstern_id = f_omr_ekstern_id, | ||
oppgavetype_ekstern_id = f_ot_ekstern_id, | ||
feltdefinisjon_ekstern_id = f_fd_ekstern_id from fasit | ||
where fasit.f_id = ova.id | ||
and ova.omrade_ekstern_id is null; |