doctrine:schema:update doesn't respect column order

前端 未结 2 633
粉色の甜心
粉色の甜心 2020-12-31 18:06

I have this Entity in Symfony2 :



        
相关标签:
2条回答
  • 2020-12-31 18:35

    If you don't want to drop/create the table, you can use @columnDefinition attribute and define the column definition yourself.

    /**
     * @var integer
     *
     * @ORM\Column(type="integer", columnDefinition="INT NOT NULL AFTER `user_id`")
     */
    private $superbanana;
    
    0 讨论(0)
  • 2020-12-31 18:44

    I don't think this is possible because using Doctrine means that you don't care about how the Table is managed anymore (apparently someone tried it before).

    And since you never use MySQL directly, I think there is no utility to specify column orders for Doctrine.

    But you can always delete your table so Doctrine will completely rebuild the table, respecting your order.

    0 讨论(0)
提交回复
热议问题