2010-06-25 102 views
0

我使用symfony 1.4與教條作爲我的ORM,我需要做兩件事情之一來讓它工作,我不知道該怎麼做。如何在教義中定義自動增量id列?

  1. ID字段不應該是BIGINT,只是int或

  2. 當我定義我的表如下:

    Table: 
        columns: 
        id: 
        type: integer 
        autoincrement: true 
        primary: true 
    

使自動增量的工作,因爲如果我定義我的ID像這樣它不會自動增加它。

回答

3

如果您沒有明確指定,則自動添加的Id鍵由Doctrine自動添加。

這應該按預期工作:

columns: 
    nextfield: string 

或:

columns: 
    id: 
    type: integer(2) 
    autoincrement: true 
    primary: true 
    nextfield: string