finish database model