code: func releasesLastVersion(db *gorm.DB, appID string) (int, error) {
  	var version int
  
  	rows, err := db.Raw(`select version from releases where app_id = ? order by version desc`, appID).Rows()
  	if err != nil {
  		return version, err
  	}
  	defer rows.Close()
  
  	for rows.Next() {
  		err := rows.Scan(&version)
  		return version, err
  	}
  
  	return version, nil
  }
docs: // ReleasesLastVersion returns the last ReleaseVersion for the given App.