开发者

In Symfony with the Doctrine ORM how do you default autoincrement columns to integer and not bigint?

开发者 https://www.devze.com 2022-12-20 15:25 出处:网络
It seems that in Symfony 1.4 with Doctrine that when generating auto-increment columns (id) it defaults to bigint.This seems like total overkill and I would just like to default it to an integer inste

It seems that in Symfony 1.4 with Doctrine that when generating auto-increment columns (id) it defaults to bigint. This seems like total overkill and I would just like to default it to an integer instead.

The following produces a primary key column named id that is a bigint

开发者_运维百科
JobeetCategory:
  actAs: { Timestampable: ~ }
  columns:
    name: { type: string(255), notnull: true, unique: true }

Is there a configuration file I can change this in. I don't want to have to manually add the id column as an integer.


Not that I'm aware of, no.

If you do end up manually adding the id columns into your schema you can specify their type as integer(4) to create a MySQL int field: http://www.symfony-project.org/doctrine/1_2/en/04-Schema-Files#chapter_04_data_types.

0

精彩评论

暂无评论...
验证码 换一张
取 消