values ($tagid, $taskid)";
(* Add the bug to the todo table with the appropriate
- * deadline.
+ * deadline. But first check if it is present in any
+ * table.
*)
- let rows =
+ let r1 =
+ PGSQL(dbh) "select 1 from imminent where taskid = $taskid" in
+ let r2 =
PGSQL(dbh) "select 1 from todo where taskid = $taskid" in
- if rows <> [Some 1_l] then
+ let r3 =
+ PGSQL(dbh) "select 1 from ideas where taskid = $taskid" in
+ let r4 =
+ PGSQL(dbh) "select 1 from retired where taskid = $taskid" in
+ if r1 <> [Some 1_l] && r2 <> [Some 1_l] &&
+ r3 <> [Some 1_l] && r4 <> [Some 1_l] then
PGSQL(dbh) "insert into todo (taskid, deadline)
values ($taskid, $my_deadline::date)";