簡體   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