···200200let serve () =
201201 Printexc.record_backtrace true ;
202202 let%lwt db = Data_store.connect ~create:true () in
203203- let%lwt () = Data_store.init db in
204203 S3.Backup.start () ;
205204 Dream.serve ~interface:"0.0.0.0" ~port:8008
206205 @@ Dream.pipeline
···221220222221let create_invite ?(uses = 1) () =
223222 let%lwt db = Data_store.connect ~create:true () in
224224- let%lwt () = Data_store.init db in
225223 let%lwt code =
226224 Api.Server.CreateInviteCode.create_invite_code ~db ~did:"admin"
227225 ~use_count:uses
+5-3
pegasus/lib/data_store.ml
···321321let connect ?create ?write () : t Lwt.t =
322322 if create = Some true then
323323 Util.mkfile_p Util.Constants.pegasus_db_filepath ~perm:0o644 ;
324324- Util.connect_sqlite ?create ?write Util.Constants.pegasus_db_location
325325-326326-let init conn : unit Lwt.t = Migrations.run_migrations Data_store conn
324324+ let%lwt db =
325325+ Util.connect_sqlite ?create ?write Util.Constants.pegasus_db_location
326326+ in
327327+ let%lwt () = Migrations.run_migrations Data_store db in
328328+ Lwt.return db
327329328330let create_actor ~did ~handle ~email ~password ~signing_key conn =
329331 let password_hash = Bcrypt.hash password |> Bcrypt.string_of_hash in
-1
pegasus/lib/repository.ml
···464464 Errors.invalid_request ~name:"RepoNotFound"
465465 "your princess is in another castle"
466466 in
467467- let%lwt () = User_store.init user_db in
468467 let%lwt {signing_key; _} =
469468 match%lwt Data_store.get_actor_by_identifier did data_store_conn with
470469 | Some actor when ensure_active = false || actor.deactivated_at = None ->
+1-2
pegasus/lib/user_store.ml
···305305 let%lwt db =
306306 Util.connect_sqlite ?create ?write (Util.Constants.user_db_location did)
307307 in
308308+ let%lwt () = Migrations.run_migrations User_store db in
308309 Lwt.return {did; db}
309309-310310-let init t : unit Lwt.t = Migrations.run_migrations User_store t.db
311310312311(* mst blocks; implements Writable_blockstore *)
313312
+1-1
pegasus/test/test_sequencer.ml
···2727 Util.connect_sqlite ~create:true ~write:true
2828 (Uri.of_string ("sqlite3://" ^ tmp))
2929 in
3030- let%lwt () = Data_store.init pool in
3030+ let%lwt () = Migrations.run_migrations Data_store pool in
3131 let%lwt () = f pool in
3232 Lwt.return ()
3333