Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -988,19 +988,21 @@ (lambda (targdb) (let* ((db (dbr:dbdat-dbh targdb)) (drp-trigger (if (member "last_update" field-names) (db:drop-trigger db tablename) #f)) - (is-trigger-dropped (if (member "last_update" field-names) + (has-last-update (member "last_update" field-names)) + (is-trigger-dropped (if has-last-update (db:is-trigger-dropped db tablename) #f)) (stmth (sqlite3:prepare db full-ins)) (changed-rows 0)) ;; (db:delay-if-busy targdb) ;; NO WAITING - (if (member "last_update" field-names) - (dbfile:print-err "is-trigger-dropped: " is-trigger-dropped)) - + (if (and + has-last-update + (common:low-noise-print 120 "is-trigger-dropped")) + (dbfile:print-err "is-trigger-dropped: " is-trigger-dropped)) (for-each (lambda (fromdat-lst) (sqlite3:with-transaction db (lambda () @@ -1118,12 +1120,12 @@ (sqlite3:for-each-row (lambda (name) (if (equal? name trigger-name) (set! res #t))) db - "SELECT name FROM sqlite_master WHERE type = 'trigger' ;" - ))) + "SELECT name FROM sqlite_master WHERE type = 'trigger' ;") + res)) (define (db:drop-triggers db) (for-each (lambda (key) (sqlite3:execute db (conc "drop trigger if exists " (car key))))