public function testExplicitRename() { $this->markTestSkipped('evauate concept for explicit field rename with doctrine2 schema tool'); $em = Setup_SchemaTool::getEntityManager('Inventory'); $sm = $em->getConnection()->getSchemaManager(); // NOTE: the DBAL schema is stateless and 'just' describes a schema in a plattform independend way // thus, all schema upgrade is based on schema comparisim $fromSchema = $sm->createSchema(); $toSchema = clone $fromSchema; $table = $toSchema->getTable('tine20_inventory_item'); // workaround -> might have problems?! $col = $table->getColumn('id'); $table->dropColumn('id'); $table->addColumn('ident', $col->getType()->getName(), $col->toArray()); // better create, copy, delete? // @TODO ask some insider // ? Schema tool can't rename cols, but schema diff with compare (at least with mysql plattform) alters table name correctly when col is renamed in annotations // non rename updates are a lot more easy $table->changeColumn('name', array('length' => 200)); $comparator = new Comparator(); $schemaDiff = $comparator->compare($fromSchema, $toSchema); $updateSql = $schemaDiff->toSql($em->getConnection()->getDatabasePlatform()); // print_r($updateSql); }