File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,16 @@ let update_many_to_many g tblname objref f db =
615615 db
616616 (Schema. many_to_many tblname (Database. schema db))
617617
618+ let uuid_of ~tblname ~objref db =
619+ try
620+ Some
621+ (Schema.Value.Unsafe_cast. string
622+ (Row. find Db_names. uuid
623+ (Table. find objref (TableSet. find tblname (Database. tableset db)))
624+ )
625+ )
626+ with _ -> None
627+
618628let set_field tblname objref fldname newval db =
619629 if fldname = Db_names. ref then
620630 failwith (Printf. sprintf " Cannot safely update field: %s" fldname) ;
@@ -696,16 +706,7 @@ let add_row tblname objref newval db =
696706 |> Database. increment
697707
698708let remove_row tblname objref db =
699- let uuid =
700- try
701- Some
702- (Schema.Value.Unsafe_cast. string
703- (Row. find Db_names. uuid
704- (Table. find objref (TableSet. find tblname (Database. tableset db)))
705- )
706- )
707- with _ -> None
708- in
709+ let uuid = uuid_of ~tblname ~objref db in
709710 let g = db.Database. manifest.Manifest. generation_count in
710711 db
711712 |> Database. update_keymap (fun m ->
You can’t perform that action at this time.
0 commit comments