2015-12-30 59 views
1

我使用DoctrineMigrationsBundle在數據庫中添加表和列。 現在我的問題是如何將現有的列移動到表中的另一個位置,或者如果它創建新的立即指定它將位於不在結束表上的位置。Symfony 2 - 添加一列到Symfony中的現有實體Id

/** 
    * @param Schema $schema 
    */ 
    public function up(Schema $schema) 
    { 
     // this up() migration is auto-generated, please modify it to your needs 
     $table = $schema->getTable('page_content'); 
     $table->changeColumn('sequence', array(
      'after' => 'id' // - hire I don't know how do this? 
     )); 
     $table->addIndex(array('sequence')); 
    } 

回答