Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1742,15 +1742,15 @@ ;; delete all runs that are state='deleted' (conc "DELETE FROM runs WHERE state='deleted' and last_update < " keep-record-age ";") ;; delete empty runs (conc "DELETE FROM runs WHERE id NOT IN (SELECT DISTINCT r.id FROM runs AS r INNER JOIN tests AS t ON t.run_id=r.id) and last_update < " keep-record-age ";") ;; remove orphaned test_rundat entries - (conc "DELETE FROM test_rundat where test_id NOT IN (SELECT id FROM tests) ;") - ;; - (conc "DELETE FROM test_steps WHERE test_id NOT IN (SELECT id FROM tests) and last_update < " keep-record-age " ;") + (conc "DELETE FROM test_rundat where test_id NOT IN (SELECT id FROM tests);") + ;; remove orphaned test_steps entries + (conc "DELETE FROM test_steps WHERE test_id NOT IN (SELECT id FROM tests);") ;; remove orphaned test_dat entries - (conc "DELETE FROM test_data WHERE test_id NOT IN (SELECT id FROM tests) and last_update < " keep-record-age " ;") + (conc "DELETE FROM test_data WHERE test_id NOT IN (SELECT id FROM tests);") )))) ;; (db:delay-if-busy dbdat) ;(debug:print-info 0 *default-log-port* statements) (sqlite3:with-transaction