beberlei / zf-doctrine

A Zend Framework 1.x and Doctrine 1.2 Integration - UNMAINTAINED
101 stars 21 forks source link

[bug + fix] zf generate-migration doctrine #11

Closed jonathan-dh closed 14 years ago

jonathan-dh commented 14 years ago

zf-doctrine - commit d26f84ae6a6e927097e6f7bb620064e5a28d3ca3 doctrine 1.2 - commit bfa24eb68640c412ff6115103ba044bbe1b4333b zend-framework 1.10.5

When trying to generate migrations, the following happens :

$ zf generate-migration doctrine --from-database

An Error Has Occurred Option "-f" is being defined more than once.

This bug is caused by the way the Zend_Console_Getopt works (or fails to work...). See here: http://framework.zend.com/issues/browse/ZF-9542?page=com.atlassian.jirafisheyeplugin%3Afisheye-issuepanel

The solution is to rename the method's params for them to all have different first characters, eg :

public function generateMigration($className=null, $d_fromDatabase=false, $m_fromModels=false)

Note: I am not suggesting this is a ~good~ fix... but it works.

beberlei commented 14 years ago

i used that approach, there is really no different one :( zend tool is strange

jonathan-dh commented 14 years ago

I've just pulled the latest version. It works great. Thx