0

我正在使用 symfony 1.4 和学说作为我的 ORM,我需要做两件事之一才能让它工作,但我不知道该怎么做。

  1. id 字段不应该是 bigint,只是 int 或

  2. 当我如下定义我的表时:

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

使自动增量工作,因为如果我像这样定义我的 id 它不会自动增量它。

4

2 回答 2

3

如果您没有明确指定,Doctrine 会自动添加自动递增的 Id 键。

这应该按预期工作:

columns:
  nextfield: string

或者:

columns:
  id:
    type: integer(2)
    autoincrement: true
    primary: true
  nextfield: string
于 2010-06-27T07:49:46.817 回答
0

对于整数数据类型,请查看:http ://www.symfony-project.org/doctrine/1_2/en/04-Schema-Files

对于自增...

  primary: true
  autoincrement: true

...应该是你所需要的。

于 2010-06-26T12:26:42.010 回答