Doctrine 2 + unsigned value

前端 未结 5 1715
闹比i
闹比i 2021-01-31 13:21

Is it possible to specify a column type of unsigned integer in Doctrine 2?

5条回答
  •  一生所求
    2021-01-31 14:07

    You can but you will loose portability. Use columnDefinition attribute and set it to integer unsigned. The actual code depends on what you are using.

    columnDefinition: DDL SQL snippet that starts after the column name and specifies the complete (non-portable!) column definition. This attribute allows to make use of advanced RMDBS features. However you should make careful use of this feature and the consequences. SchemaTool will not detect changes on the column correctly anymore if you use “columnDefinition”.

    Doctrine reference: https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#column

提交回复
热议问题