building the db model