Closed plfort closed 9 years ago
I didn't test on 2.4.* ... I will fix it
@plfort wow your PR is way better than mine https://github.com/doctrine/data-fixtures/pull/204
Did you manage to fix the tests?
I think there was some error on travis, because only PHP5.3 failed. So this must have been some kind of glitch or error in Anotations regarding this version of PHP or uncleared cache. Can someone rerun tests on travis?
@fon60 actually it failed with PHP 5.3 & doctrine-orm
2.4.7, look at the output of Composer in Travis
This is because doctrine-orm
2.5.* needs at least PHP 5.4, while doctrine-orm
2.4.7 works with PHP 5.3
@plfort the Travis build completed successfully, great :smile:
@lavoiesl do you think we can merge this PR ?
+1 on this.
I hit the same problem today, ORMPurger ignores schema name on postgresql and produces wrong delete query before running fixtures.
DELETE FROM core.users
DELETE FROM users
My entity:
<?php
namespace Core\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="users", schema="core")
*/
class User
{
}
and output of the data-fixture:import
command is:
[Doctrine\DBAL\Exception\TableNotFoundException]
An exception occurred while executing 'DELETE FROM users':
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "users" does not exist
@edigu did you try with this branch?
Yes. I just tried now with dev-master#7c4d7c
and my fixtures are loaded without any problems even with --purge-with-truncate
argument. So i can confirm that ORMPurger properly generates the delete query with this PR. @plfort thanks for your effort.
So now what? I'm waiting for this PR very much.
Not sure who are the maintainers of this project
:+1:
Will this make into 1.x?
I'm also waiting for release with this fix.
For now I'm just doing all manually with --append
;)
I am still having issues with this. Can anyone send me a working example of a composer.json using symfony3?
No matter what I try I can't get the fixtures to detect my schema names for my entities. It detects my schema names on my ManyToMany join tables, but not my actual entities.
So I found my issue, but this took way longer to resolve than I expected:
my composer.json had: "doctrine/doctrine-fixtures-bundle": "^2.3"
But did not contain a reference to "doctrine/data-fixtures". As such I was grabbing v1.1.1 of "doctrine/data-fixtures", which is the latest stable release however it does NOT include this correction.
Anyone care to comment on when we might be getting an updated stable release?
To correct my problem I had to add this to my composer.json: "doctrine/data-fixtures": "dev-master"
Use QuoteStrategy to get table names See #191