1

所以我想为具有大量表的数据库中的特定表生成实体。

这是我正在尝试的命令:

php app/console doctrine:mapping:convert yml ./src/MyNamespace/Bundle/MyNamespaceBundle/Resources/config/doctrine/metadata/orm --from-database --em=my_manager --filter=TblReports --verbose

这是错误:

[Doctrine\DBAL\DBALException]                                                                            
  Unknown database type unknown requested, Doctrine\DBAL\Platforms\PostgreSqlPlatform may not support it. 

现在我可以在只有几个表的较小数据库上运行这个命令并且它工作正常,所以它必须是数据库。

是的,我想过滤这张表:

--filter=TblReports

如果我删除过滤器,它会为整个数据库生成实体,这是我不想要的。

如果这很重要,我正在运行 PostgreSQL 8.4 和 9.1。

其他人有或知道如何解决这个问题?

Unknown database type unknown requested

教义文件

相关:

更新:添加 my_manager ( config.yml )

# Doctrine Configuration
doctrine:
    dbal:
      default_connection: my_database
      connections:
        my_database:
          driver:   pdo_pgsql
          port:     5432
          dbname:   tbl_reports
          user:     foo_user
          password: foo_pass
          charset:  UTF8
          mapping_types:
            bit: string

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        default_entity_manager: my_manager
        entity_managers:
            my_manager:
                connection: my_database
                mappings:
                    MyNamespaceBundle:
                      mapping: true
                      dir: Entity/Reports

在 config_dev.yml 中(我使用 dev 和 prod yml 文件来控制我可以连接到的主机)

# Doctrine Configuration
doctrine:
    dbal:
      connections:
        my_database:
          host: 172.0.0.1
4

1 回答 1

2

我同意 Ziumin 的观点,即 Postgres 数据库中的数据类型可能存在问题。可能是 Enum 或类似的。

我要做的是尝试一张一张地转换表,直到将其缩小到问题表,然后查看数据类型,它应该是相当明显的。

于 2012-12-05T21:11:19.527 回答