简体   繁体   English

数据库表中的Symfony2字段顺序

[英]Symfony2 field order in database table

I have generated 2 entities in my bundle and then using app/console doctrine:schema:update --force I recreate database schema. 我在捆绑包中生成了2个实体,然后使用app/console doctrine:schema:update --force重新创建数据库架构。 The order of fields that I have defined in the entities does not match the order of fields in the database table. 我在实体中定义的字段顺序与数据库表中的字段顺序不匹配。 Is there a way to control/define order in which fields are listed in the database table? 有没有一种方法可以控制/定义数据库表中列出的字段的顺序?

Thanks, Z 谢谢Z

It's not a problem; 这不是一个问题; If you have generated the schema first then you updated it, the new fields will be just appended to current columns. 如果您首先生成了架构,然后对其进行了更新,则新字段将仅追加到当前列中。

Furthermore you can find this different order for columns which has relationship which will be appended, too (on the generation time). 此外,对于具有关联关系的列,您也可以找到这种不同的顺序(在生成时)。 In fact it does not create any issue; 实际上,它不会产生任何问题。 but if it's important to you, you can change the arrangement through one of the DataBase Management Tools (eg phpMyAdmin) 但是如果对您来说很重要,则可以通过一种数据库管理工具(例如phpMyAdmin)来更改排列方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM