【问题标题】:Cross database joins with Doctrine in PHP跨数据库加入 PHP 中的 Doctrine
【发布时间】:2013-03-13 15:35:01
【问题描述】:

我在他们的博客上阅读了关于 Doctrine 中的跨数据库连接的信息:http://www.doctrine-project.org/blog/cross-database-joins.html 问题是每当表名包含点(用于指定数据库)时,doctrine:schema:update 输出Nothing to update - your database is already in sync with the current entity metadata. 命令基本上只是忽略表名包含点的实体。

【问题讨论】:

标签: php symfony doctrine-orm doctrine multiple-databases


【解决方案1】:

这是正常的,是 ORM/DBAL 的限制。

Doctrine\ORM\Tools\SchemaTool 使用 schema manager retrieved from your current connection

Doctrine\DBAL\Schema\AbstractSchemaManager 读取表 from the current connection's db,而不是从所有数据库中读取。

因此,您必须手动处理放置在不同数据库中的表,或者使用您自己的架构管理器和您自己的listTables 实现。

【讨论】:

  • 如果是这样的话,我想我会使用多个实体管理器。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-06-25
  • 2010-12-13
  • 1970-01-01
  • 2016-03-01
  • 2018-11-06
  • 1970-01-01
  • 2016-09-06
相关资源
最近更新 更多