From b02fdc09375576bf0d25d6ef49b938efbd3a7de9 Mon Sep 17 00:00:00 2001 From: ABLL526 Date: Fri, 21 Feb 2025 19:49:43 +0200 Subject: [PATCH] Change checkpoint's table DDL, set column measured_by_atum_agent to have NOT NULL constraint with DEFAULT FALSE #242 Made changes: 1. Changed the value of measured_by_atum_agent in Checkpoints DDL to NOT NULL. 2. Changed the value of measured_by_atum_agent in Checkpoints DDL to DEFAULT FALSE. 3. Changed the value of measured_by_atum_agent in Write Checkpoints to DEFAULT FALSE. 4. Changed the tests to accommodate this change, it has been tested successfully. 5. Made changes to the WriteCheckpoint.scala files. --- .../server/api/database/runs/functions/WriteCheckpoint.scala | 4 ++-- .../api/database/runs/functions/WriteCheckpointV2.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpoint.scala b/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpoint.scala index ce6c5c129..b20327e46 100644 --- a/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpoint.scala +++ b/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpoint.scala @@ -42,8 +42,8 @@ class WriteCheckpoint(implicit schema: DBSchema, dbEngine: DoobieEngine[Task]) fr"${values.processStartTime}", fr"${values.processEndTime}", fr"${values.measurements.toList.map(_.asJson)}", - fr"${values.measuredByAtumAgent}", - fr"${values.author}" + fr"${values.author}", + fr"${values.measuredByAtumAgent}" ) ) with StandardStatusHandling diff --git a/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpointV2.scala b/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpointV2.scala index ff797dd70..1e66f5aea 100644 --- a/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpointV2.scala +++ b/server/src/main/scala/za/co/absa/atum/server/api/database/runs/functions/WriteCheckpointV2.scala @@ -39,8 +39,8 @@ class WriteCheckpointV2(implicit schema: DBSchema, dbEngine: DoobieEngine[Task]) fr"${args.checkpointV2DTO.processStartTime}", fr"${args.checkpointV2DTO.processEndTime}", fr"${args.checkpointV2DTO.measurements.toList.map(_.asJson)}", - fr"${args.checkpointV2DTO.measuredByAtumAgent}", - fr"${args.checkpointV2DTO.author}" + fr"${args.checkpointV2DTO.author}", + fr"${args.checkpointV2DTO.measuredByAtumAgent}" ), Some("write_checkpoint") )