Skip to content

Commit

Permalink
Don't register prepared statement for migration queries
Browse files Browse the repository at this point in the history
  • Loading branch information
joseferben committed Jul 31, 2020
1 parent cd33e2b commit f169df6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/data/data_migration_service.ml
Expand Up @@ -63,7 +63,9 @@ struct
| Model.Migration.{ label; statement; check_fk = true } :: steps -> (
Logs.debug (fun m -> m "MIGRATION: Running %s" label);
let query (module Connection : Caqti_lwt.CONNECTION) =
let req = Caqti_request.exec Caqti_type.unit statement in
let req =
Caqti_request.exec ~oneshot:true Caqti_type.unit statement
in
Connection.exec req () |> Lwt_result.map_err Caqti_error.show
in
Db.query ctx query >>= function
Expand All @@ -84,7 +86,9 @@ struct
Logs.debug (fun m ->
m "MIGRATION: Running %s without fk checks" label);
let query (module Connection : Caqti_lwt.CONNECTION) =
let req = Caqti_request.exec Caqti_type.unit statement in
let req =
Caqti_request.exec ~oneshot:true Caqti_type.unit statement
in
Connection.exec req () |> Lwt_result.map_err Caqti_error.show
in
Db.query ctx query >>= function
Expand Down

0 comments on commit f169df6

Please sign in to comment.