split out db.define (from code that runs it)