簡體   English   中英

Symfony 1.4 和 doctrine 自動增量而不是 auto_increment

[英]Symfony 1.4 and doctrine autoincrement instead of auto_increment

我有一個奇怪的問題。

這是我的 yaml:

Request: actAs: { Timestampable: ~ } columns: id: { type: integer(4), primary: true, autoincrement: true, notnull: true }

When i perform a symfony doctrine:build --all --no-confirmation inside my BaseRequest.class.php there's an error during the declaration of my id field:

$this->hasColumn('id', 'integer', 4, array( 'type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => 4, ));

如您所見,它應該是 auto_increment 但它是自動增量,因此我必須在每次構建后手動更改它。

有沒有什么辦法解決這一問題?

不完全回答您的問題,但您不需要為您的實體指定 id 列,doctrine 會自動執行此操作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM