[英]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.