We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jira issue originally created by user inhack20:
In symfony2 the command doctrine:fixtures:load Fails One-To-Many, Self-referencing using Doctrine\Common\DataFixtures\Purger\ORMPurger in example:
Doctrine\Common\DataFixtures\Purger\ORMPurger
class DescriptionArea { //.. /**** * @ORM\OneToMany(targetEntity="DescriptionArea", mappedBy="parent") */ protected $descriptionAreas; /**** * @ORM\ManyToOne(targetEntity="DescriptionArea", inversedBy="descriptionAreas") */ protected $parent; //.. }
Throw error: [Doctrine\DBAL\DBALException] An exception occurred while executing 'DELETE FROM prefix_DescriptionArea': SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (sigtec*dev.prefix*DescriptionArea, CONSTRAINT FK*7265873E727ACA70 FOREIGN KEY (parent_id) REFERENCES prefix*DescriptionArea (id))
Before running the query should delete the index when the table has self-reference.
The text was updated successfully, but these errors were encountered:
I'm having the same for but not or a self referencing relation.
/** * @ORM\OneToMany(targetEntity="Person", mappedBy="organisationalUnit") **/ private $persons; /** * @ORM\ManyToOne(targetEntity="OrganisationalUnit", inversedBy="persons") * @ORM\JoinColumn(name="organisational_unit_id", nullable=false) */ private $organisationUnit;
Sorry, something went wrong.
To be tracked in doctrine/data-fixtures#127 instead.
Closing as duplicate
Actually mine fails with Postgres 9.4.5 and not with MySQL.
@DannyvdSluijs consider looking into the doctrine/data-fixtures issue tracker first anyway :)
Ocramius
No branches or pull requests
Jira issue originally created by user inhack20:
In symfony2 the command doctrine:fixtures:load Fails One-To-Many, Self-referencing using
Doctrine\Common\DataFixtures\Purger\ORMPurger
in example:Before running the query should delete the index when the table has self-reference.
The text was updated successfully, but these errors were encountered: