Skip to content

Commit

Permalink
🗃️ Fjerner notat_ref fra kommentarer-tabell
Browse files Browse the repository at this point in the history
* kommentarer peker nå bare på dialog
  • Loading branch information
elitho committed Nov 15, 2024
1 parent 8fc302c commit bf3a2ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE kommentarer DROP COLUMN notat_ref;
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ internal class PersonRepository(
@Language("PostgreSQL")
val query = """
DELETE FROM kommentarer
WHERE notat_ref IN (
SELECT n.id
WHERE dialog_ref IN (
SELECT n.dialog_ref
FROM notat n
INNER JOIN vedtak v ON n.vedtaksperiode_id = v.vedtaksperiode_id
WHERE v.person_ref = ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ INSERT INTO dialog(id, opprettet)
VALUES (${sequence_number}, now());
INSERT INTO notat(id, tekst, opprettet, saksbehandler_oid, vedtaksperiode_id, feilregistrert, feilregistrert_tidspunkt, dialog_ref)
VALUES (${sequence_number}, 'TEST_TEXT', now(), '${saksbehandler_oid}', '${vedtaksperiode_id}', false, now(), ${sequence_number});
INSERT INTO kommentarer(tekst, notat_ref, feilregistrert_tidspunkt, saksbehandlerident, dialog_ref)
VALUES ('EN_KOMMENTAR', ${sequence_number}, null, '${saksbehandler_oid}', ${sequence_number});
INSERT INTO kommentarer(tekst, feilregistrert_tidspunkt, saksbehandlerident, dialog_ref)
VALUES ('EN_KOMMENTAR', null, '${saksbehandler_oid}', ${sequence_number});

INSERT INTO overstyring(id, tidspunkt, person_ref, hendelse_ref, saksbehandler_ref, vedtaksperiode_id)
VALUES (${sequence_number}, now(), ${sequence_number}, '${hendelse_id}',
Expand Down

0 comments on commit bf3a2ab

Please sign in to comment.