-
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.
Merge pull request #61 from navikt/fix/type-errors-after-tiltakstype-…
…overhaul Fix typing errors and adjustments to frontend to conform to changes of tiltakstyper
- Loading branch information
Showing
30 changed files
with
422 additions
and
204 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
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
16 changes: 16 additions & 0 deletions
16
backend/src/main/resources/db/migration/V22__alter_tiltakstype_id.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,16 @@ | ||
-- Remove constraint | ||
ALTER TABLE tiltaksgjennomforing DROP CONSTRAINT fk_tiltakstype; | ||
|
||
-- Add new column | ||
ALTER TABLE tiltaksgjennomforing ADD COLUMN tiltakskode tiltakskode; | ||
ALTER TABLE tiltaksgjennomforing | ||
ADD CONSTRAINT fk_tiltakskode FOREIGN KEY (tiltakskode) REFERENCES tiltakstype (tiltakskode); | ||
|
||
-- Migrate rows | ||
UPDATE tiltaksgjennomforing t1 | ||
SET tiltakskode = t2.tiltakskode | ||
FROM tiltakstype t2 | ||
WHERE t1.id = t2.id; | ||
|
||
-- Drop old column | ||
ALTER TABLE tiltaksgjennomforing DROP COLUMN tiltakstype_id; |
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
7 changes: 3 additions & 4 deletions
7
backend/src/main/resources/db/migration/testdata/R__2_add_tiltaksgjennomforinger_data.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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
-- INSERT INTO tiltaksgjennomforing | ||
-- VALUES (1, 13, 'Truckførerkurs i Namsos', | ||
-- 'Her kan du lære å kræsje med truck.', 1000, '2020-06-01', '2020-12-01') | ||
-- INSERT INTO tiltaksgjennomforing (id, tittel, beskrivelse, tiltaksnummer, fra_dato, til_dato, tiltakskode) | ||
-- VALUES (1, 'Truckførerkurs i Namsos', | ||
-- 'Her kan du lære å kræsje med truck.', 1000, '2020-06-01', '2020-12-01', 'ABIST') | ||
-- ON CONFLICT (id) DO UPDATE SET tittel = EXCLUDED.tittel, | ||
-- tiltakstype_id = EXCLUDED.tiltakstype_id, | ||
-- beskrivelse = EXCLUDED.beskrivelse; | ||
-- | ||
-- SELECT setval('tiltaksgjennomforing_id_seq', (SELECT MAX(id) from "tiltaksgjennomforing")); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
VITE_BACKEND_API_ROOT='' | ||
VITE_BACKEND_API_ROOT='http://localhost:8080' | ||
VITE_ENABLE_MOCK=true |
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
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
Oops, something went wrong.