From eb786088e7269d853d826ae4ca52216da571be51 Mon Sep 17 00:00:00 2001 From: Robur Date: Wed, 30 Jun 2021 09:56:47 +0000 Subject: [PATCH] Builder_db.Job_tag.add: use INSERT OR REPLACE to avoid constraint violation --- bin/migrations/m20210629.ml | 2 +- db/builder_db.ml | 2 +- lib/model.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/migrations/m20210629.ml b/bin/migrations/m20210629.ml index b6c30ca..591dbda 100644 --- a/bin/migrations/m20210629.ml +++ b/bin/migrations/m20210629.ml @@ -75,7 +75,7 @@ let infer_section_and_synopsis artifacts = if OpamPackage.Set.exists (fun p -> OpamPackage.Name.equal p.OpamPackage.name influx) switch.OpamFile.SwitchExport.selections.OpamTypes.sel_installed then - "Unikernel (monitoring)" + "Unikernel (with metrics reported to Influx)" else "Unikernel" in diff --git a/db/builder_db.ml b/db/builder_db.ml index 1abf6fa..158ae95 100644 --- a/db/builder_db.ml +++ b/db/builder_db.ml @@ -157,7 +157,7 @@ module Job_tag = struct let add = Caqti_request.exec Caqti_type.(tup3 id string id) - "INSERT INTO job_tag (tag, value, job) VALUES (?, ?, ?)" + "INSERT OR REPLACE INTO job_tag (tag, value, job) VALUES (?, ?, ?)" let get_value = Caqti_request.find diff --git a/lib/model.ml b/lib/model.ml index e0d18b7..141c645 100644 --- a/lib/model.ml +++ b/lib/model.ml @@ -209,7 +209,7 @@ let infer_section_and_synopsis artifacts = if OpamPackage.Set.exists (fun p -> OpamPackage.Name.equal p.OpamPackage.name influx) switch.OpamFile.SwitchExport.selections.OpamTypes.sel_installed then - "Unikernel (monitoring)" + "Unikernel (with metrics reported to Influx)" else "Unikernel" in