-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat. ta høyde for deltaker id i arena_agreement_migration
Det kan være flere deltakere på et tiltak. Derfor må vi ta høyde for dette.
- Loading branch information
Showing
4 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
14 changes: 14 additions & 0 deletions
14
src/main/resources/db/migration/V117__tiltakdeltaker_id_arena-agreement_migration.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,14 @@ | ||
ALTER TABLE arena_agreement_migration ADD COLUMN tiltakdeltaker_id int; | ||
|
||
UPDATE arena_agreement_migration aam | ||
SET tiltakdeltaker_id = ( | ||
SELECT tiltakdeltaker_id | ||
FROM arena_tiltakdeltaker | ||
WHERE tiltakgjennomforing_id = aam.tiltakgjennomforing_id | ||
LIMIT 1 | ||
); | ||
|
||
ALTER TABLE arena_agreement_migration | ||
ADD CONSTRAINT arena_agreement_migration_tiltakdeltaker_id_fkey | ||
FOREIGN KEY (tiltakdeltaker_id) | ||
REFERENCES arena_tiltakdeltaker(tiltakdeltaker_id); |