LiipFunctionalTestBundle icon indicating copy to clipboard operation
LiipFunctionalTestBundle copied to clipboard

ORMPurger::PURGE_MODE_TRUNCATE tries to find tables in wrong database in case of multiple databases and if bundles are shared between multiple entity manager.

Open vishalmelmatti opened this issue 12 years ago • 3 comments

Hi, I have config something like below, to use AcmeUsersBundle entities in AcmeDemoBundle I have added AcmeUsersBundle under default.

        default:
            connection: default
            mappings:
              AcmeDemoBundle : ~
              AcmeUsersBundle : ~
        users:
            connection: ownership
            mappings:
            AcmeUsersBundle : ~

this->loadFixtures($classes, null, 'doctrine', ORMPurger::PURGE_MODE_TRUNCATE);

Tests tries to find Users database tables under default database as entities are shared, and truncate fails.

Also in case of cross database join, I had to use database name in mapping yml, e.g.

in Users.orm.yml

table: users.profile , it is with db name, so it will truncate Production database and not users_testing.profile.

What could be the solution ?

vishalmelmatti avatar Dec 10 '13 14:12 vishalmelmatti

when i wrote the Bundle I did not really thnk of multiple managers. we did pull in one PR to help a user that needed support for this in https://github.com/liip/LiipFunctionalTestBundle/pull/29 .. but I personally have no experience there.

lsmith77 avatar Dec 10 '13 23:12 lsmith77

@alexislefebvre Could you please tell more about the "move-to-fixtures-repository"?

Is this fixed in 3.0? Thanks!

soullivaneuh avatar Jun 07 '19 12:06 soullivaneuh

@soullivaneuh this is a label to keep track of issues and PR which should be moved to https://github.com/liip/LiipTestFixturesBundle, because all the database features have been removed in the 3.x version of LiipFunctionalTestBundle.

alexislefebvre avatar Jun 07 '19 13:06 alexislefebvre