build the db