繁体   English   中英

Doctrine 架构问题:使用数组类型时更新

[英]Doctrine problems with the schema:update when using an array type

我正在使用以下 orm 描述:

App\Entity\Journal:
type: entity
table: hpa_journal
repositoryClass: App\Repository\JournalRepository
id:
    id:
        type: integer
        id: true
        generator:
            strategy: AUTO
fields:
    longDescription:
        type: array
        nullable: true
        column: long_description

当我运行doctrine:schema:create它完全没有问题并创建数据库。 但是,当我运行schema:update时,出现以下错误:

php bin/console doctrine:schema:update --dump-sql

 The following SQL statements will be executed:
     ALTER TABLE HPA_JOURNAL MODIFY (long_description CLOB DEFAULT NULL);

这是没有意义的,因为CLOB已经是DEFAULT NULL , doctrine 使用schema:create

当我运行schema:update --force以消除该消息时,我收到 ORACLE 错误:

ORA-22859: invalid modification of columns

当 doctrine 比较 DB 和 model 时,它会触发一个问题,因为在 DB 中,类型“文本”、“数组”、“json_array”……只是 CLOBS。 为了真正发挥作用,您必须添加(如果不是像我的情况那样自动添加)适当的评论:

COMMENT ON COLUMN HPA_JOURNAL.LONG_DESCRIPTION IS '(DC2Type:array)'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM