Doctrine 2 + unsigned value

前端 未结 5 1726
闹比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 13:56

    I have the same problem with doctrine 2. and i solve it the same way, but there are some advantages :

    /**
     * @ORM\Column(name="id", type="integer", options={"unsigned"=true})
     */
    

    Running diff migration bin/console doctrine:migration:diff will do some magic.In fact, if the column was a foreign key in other tables, the doctrine is able to find them out and apply the same update row as the concerned column.

    You just need in your migration to remove foreign keys before and add them after the column type transformation.

提交回复
热议问题