Add database model, implement insert function