johmue/mysql-workbench-schema-exporter — Issue #51: Having to write @JoinColumn in order to use "doctrine orm:schema-tool:create"
Author: quincyglenn
Created: 2012-03-06 21:28:17+00:00
State: open

First off, thanks for your hard work in creating this indispensable tool, it has saved me lots of production time. You should have a donation link somewhere ;).

Anyways, Below is the code I use to export my schema which has various one-to-one and one-to-many relationships. I am using a Zend Framework 1 setup with Doctrine 2 integration. If I run "doctrine orm:schema-tool:create" I get a error like "There is no column with name 'debate_user_id' on table 'debate'.". So I have to go in an add @JoinColumn annotations and then all is well. Is there a option I am missing or using wrong?

Thanks again for this awesome library.

require_once('mysql-workbench-schema-exporter/lib/MwbExporter/Core/SplClassLoader.php');
$classLoader = new SplClassLoader();
$classLoader->setIncludePath('mysql-workbench-schema-exporter/lib');
$classLoader->register();
$setup = array(
'enhancedManyToManyDetection' => 'false',
'entityNamespace' => 'Application\Entity',
'filename' => '%entity%.%extension%',
'indentation' => 4,
);
$formatter = new \MwbExporter\Formatter\Doctrine2\Annotation\Loader($setup);
$mwb = new \MwbExporter\Core\Workbench\Document('test.db', $formatter);
echo $mwb->zipExport(__DIR__, 'php') . PHP_EOL;"