Skip to content

Commit

Permalink
fix. fikset v117 migrering som failet ved deploy dersom det var data …
Browse files Browse the repository at this point in the history
…i tabellen (#1240)
  • Loading branch information
eirikv authored Dec 13, 2024
1 parent 72ddb38 commit c4bb366
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ALTER TABLE arena_agreement_migration ADD COLUMN tiltakdeltaker_id int;

UPDATE arena_agreement_migration aam
SET tiltakdeltaker_id = (
SELECT tiltakdeltaker_id
SET tiltakdeltaker_id = subquery.tiltakdeltaker_id
FROM (
SELECT tiltakgjennomforing_id, tiltakdeltaker_id
FROM arena_tiltakdeltaker
WHERE tiltakgjennomforing_id = aam.tiltakgjennomforing_id
LIMIT 1
);
) as subquery
WHERE aam.tiltakgjennomforing_id = subquery.tiltakgjennomforing_id;

ALTER TABLE arena_agreement_migration
ADD CONSTRAINT arena_agreement_migration_tiltakdeltaker_id_fkey
Expand Down

0 comments on commit c4bb366

Please sign in to comment.