Skip to content

Commit

Permalink
feat: drop soknad column
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Feb 6, 2024
1 parent e42bc1c commit acc1ea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/main/resources/db/V26__drop_big_soknad.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table soknad drop column soknad;
13 changes: 5 additions & 8 deletions src/test/kotlin/no/nav/syfo/util/TestDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,13 @@ fun DatabaseInterface.insertOrUpdate(soknadDbModel: SoknadDbModel) {
sykmelding_id,
pasient_fnr,
orgnummer,
soknad,
sykepengesoknad,
sendt_dato,
lest,
timestamp,
tom)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) on CONFLICT(soknad_id) do update
values (?, ?, ?, ?, ?, ?, ?, ?, ?) on CONFLICT(soknad_id) do update
set sykepengesoknad = excluded.sykepengesoknad,
soknad = excluded.soknad,
sykmelding_id = excluded.sykmelding_id,
pasient_fnr = excluded.pasient_fnr,
orgnummer = excluded.orgnummer,
Expand All @@ -304,14 +302,13 @@ fun DatabaseInterface.insertOrUpdate(soknadDbModel: SoknadDbModel) {
preparedStatement.setString(3, soknadDbModel.pasientFnr)
preparedStatement.setString(4, soknadDbModel.orgnummer)
preparedStatement.setObject(5, soknadDbModel.soknad.toPGObject())
preparedStatement.setObject(6, soknadDbModel.soknad.toPGObject())
preparedStatement.setObject(7, soknadDbModel.sendtDato)
preparedStatement.setBoolean(8, soknadDbModel.lest)
preparedStatement.setObject(6, soknadDbModel.sendtDato)
preparedStatement.setBoolean(7, soknadDbModel.lest)
preparedStatement.setTimestamp(
9,
8,
Timestamp.from(soknadDbModel.timestamp.toInstant())
)
preparedStatement.setObject(10, soknadDbModel.tom)
preparedStatement.setObject(9, soknadDbModel.tom)
preparedStatement.executeUpdate()
}
connection.commit()
Expand Down

0 comments on commit acc1ea1

Please sign in to comment.