code: func dbFetchOrCreateVersion(dbTx database.Tx, key []byte, defaultVersion uint32) (uint32, error) {
  	version := dbFetchVersion(dbTx, key)
  	if version == 0 {
  		version = defaultVersion
  		err := dbPutVersion(dbTx, key, version)
  		if err != nil {
  			return 0, err
  		}
  	}
  
  	return version, nil
  }
docs: // dbFetchOrCreateVersion uses an existing database transaction to attempt to
  // fetch the provided key from the metadata bucket as a version and in the case
  // it doesn't exist, it adds the entry with the provided default version and
  // returns that.  This is useful during upgrades to automatically handle loading
  // and adding version keys as necessary.