Fix migrate-2023-09-11 by dropping hte index first
This commit is contained in:
parent
db115ad140
commit
89f2c54973
1 changed files with 6 additions and 0 deletions
|
@ -5,8 +5,13 @@ and rollback_doc = "index failed builds on exit code"
|
||||||
|
|
||||||
open Grej.Syntax
|
open Grej.Syntax
|
||||||
|
|
||||||
|
let drop_idx_build_failed =
|
||||||
|
Caqti_type.(unit ->. unit) @@
|
||||||
|
"DROP INDEX idx_build_failed"
|
||||||
|
|
||||||
let migrate _datadir (module Db : Caqti_blocking.CONNECTION) =
|
let migrate _datadir (module Db : Caqti_blocking.CONNECTION) =
|
||||||
let* () = Grej.check_version ~user_version:old_version (module Db) in
|
let* () = Grej.check_version ~user_version:old_version (module Db) in
|
||||||
|
let* () = Db.exec drop_idx_build_failed () in
|
||||||
let* () =
|
let* () =
|
||||||
Db.exec (Caqti_type.unit ->. Caqti_type.unit @@
|
Db.exec (Caqti_type.unit ->. Caqti_type.unit @@
|
||||||
"CREATE INDEX idx_build_failed ON build(job, start_d DESC, start_ps DESC) \
|
"CREATE INDEX idx_build_failed ON build(job, start_d DESC, start_ps DESC) \
|
||||||
|
@ -17,6 +22,7 @@ let migrate _datadir (module Db : Caqti_blocking.CONNECTION) =
|
||||||
|
|
||||||
let rollback _datadir (module Db : Caqti_blocking.CONNECTION) =
|
let rollback _datadir (module Db : Caqti_blocking.CONNECTION) =
|
||||||
let* () = Grej.check_version ~user_version:new_version (module Db) in
|
let* () = Grej.check_version ~user_version:new_version (module Db) in
|
||||||
|
let* () = Db.exec drop_idx_build_failed () in
|
||||||
let* () =
|
let* () =
|
||||||
Db.exec (Caqti_type.unit ->. Caqti_type.unit @@
|
Db.exec (Caqti_type.unit ->. Caqti_type.unit @@
|
||||||
"CREATE INDEX idx_build_failed ON build(job, start_d DESC, start_ps DESC) \
|
"CREATE INDEX idx_build_failed ON build(job, start_d DESC, start_ps DESC) \
|
||||||
|
|
Loading…
Reference in a new issue