/**
  * Adds a version into storage
  *
  * @param Version $version
  *
  * @return Migration
  * @throws StorageException
  */
 public function save(Version $version)
 {
     if ($this->findMigrationByVersion($version)) {
         throw new StorageException(sprintf('Version with id "%s" already exists.', $version->getId()));
     }
     $migration = new Migration();
     $migration->setId($version->getId());
     $migration->save();
     return $migration;
 }