2010-06-25 38 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