From cc092ca9d8a88dc14dc74a86e93fa006efabe697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 5 Jul 2021 10:21:07 +0200 Subject: [PATCH] M20210701: reapply index --- bin/migrations/m20210701.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/migrations/m20210701.ml b/bin/migrations/m20210701.ml index 6d74db0..493ec83 100644 --- a/bin/migrations/m20210701.ml +++ b/bin/migrations/m20210701.ml @@ -3,6 +3,10 @@ let identifier = "2021-07-01" let migrate_doc = "build.main_binary deferred foreign key constraint" let rollback_doc = "build.main_binary immediate foreign key constraint" +let idx_build_job_start = + Caqti_request.exec Caqti_type.unit + "CREATE INDEX idx_build_job_start ON build(job, start_d DESC, start_ps DESC)" + let new_build = Caqti_request.exec Caqti_type.unit @@ -76,6 +80,7 @@ let migrate _datadir (module Db : Caqti_blocking.CONNECTION) = Db.exec copy_build () >>= fun () -> Db.exec drop_build () >>= fun () -> Db.exec rename_build () >>= fun () -> + Db.exec idx_build_job_start () >>= fun () -> Db.exec (Grej.set_version new_version) () let rollback _datadir (module Db : Caqti_blocking.CONNECTION) = @@ -84,4 +89,5 @@ let rollback _datadir (module Db : Caqti_blocking.CONNECTION) = Db.exec copy_build () >>= fun () -> Db.exec drop_build () >>= fun () -> Db.exec rename_build () >>= fun () -> + Db.exec idx_build_job_start () >>= fun () -> Db.exec (Grej.set_version old_version) ()