mv db definitions from __init__ to _db_model