Closed benglass closed 10 years ago
@benglass I have the same problem and sadly I don't have a solution to this problem...
@kayue Related discussion in doctrine data fixtures library
@benglass Thanks!
Beside purging, schema update is also a problem in this bundle.
Solution is to provide a separate entity manager.
The solution for schema update is to use the doctrine configuration schemafilter option to get doctrine to ignore tables starting with wp
http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html#manual-tables
doctrine:
dbal:
schema_filter: ~^(?!wp_)~
This issue can technically be closed but it might be nice to put this information in the documentation
Cool stuff! :+1:
Will update the doc and then I will close the issue. Thanks a lot!
@benglass In v2 the bundle uses Doctrine connection instead of Entity Manager, which solve this problem from the root.
It comes with other BC so please test it first :)
@kayue thanks for the heads up! Any way you could point me at a file that shows how it is using the connection instead of the entity manager? I browsed the beta 2.* tag and it looks like normal doctrine entities to me
@benglass We still create entity manager, but we no longer register WordpressBundle's entities to the default entity manager, we now create the entity manager from sketch, thus it won't mess up the Doctrine schema tools.
https://github.com/kayue/KayueWordpressBundle/blob/master/Wordpress/ManagerRegistry.php#L70
It seems that this bundle may have a compatibility issue with doctrine fixtures and migrations in that it causes doctrine to want to modify wordpress tables whenever you generate a schema diff or when you try to load fixtures.
We like that this bundle provides a doctrine-friendly interface to retrieving and displaying blog data, but we need the blog tables to not be effected by doctrine fixtures because they are part of the wordpress application and not the main application. Doctrine fixtures wants to modify foreign keys on wordpress tables and complains that wp_blogs table doesnt exist if you arent using a multi-blog wordpress install.
Are we doing something wrong? Is there a way to solve this via configuration?