Skip to content

Instantly share code, notes, and snippets.

@skoop
Created July 25, 2012 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skoop/3175359 to your computer and use it in GitHub Desktop.
Save skoop/3175359 to your computer and use it in GitHub Desktop.
keeping old IDs in data migration
$this->em->persist($newUrl);
$metadata = $this->em->getClassMetaData(get_class($newUrl));
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
$this->em->flush();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment