MySQL Workbench Propel export plugin v0.4
I finally came around to update the Workbench propel export plugin. Sorry that it took so long.
This is what is new:
- Added support to set database baseClass manually
- Added support to set phpName per table manually
- DATETIME type is converted to TIMESTAMP type
- Added support for onDelete and onUpdate foreign key constraints (based on work by Antoine Noal aka Hvannentir)
- size and scale support for DECIMAL columns (based on work by Antoine Noal aka Hvannentir)
- support for multiple foreign key references (thanks for pointing that out Antoine!)
The first to features where added because I want to have other PHP-names than what propel generates automatically (Table named customers but class name should be Customer). I also have a custom baseClass injected in the inheritance tree to be able implement generic features for all my objects, so I needed the baseClass attribute. – Not beeing able to set this from the workbench export meant that I had to patch the generated schema file on every update with a small script which corrected the issues. With the new features I can now omit that extra step.
To use the baseClass-functionality, just use the new menu-entry “PropelExport: Set custom baseClass” inside Plugins -> Catalog.
To use the phpName-functionality, simply right-click on a table and use “PropelExport: Set custom phpName”.
Important to note: If you want to remove a previously set baseClass or phpName, enter one empty space as name. (I had to do this because of a shortcoming of MySQL Workbench, which does not enable me to differentiate between an entered empty string or a press on cancel).
The entered names are also saved in the Workbench file, so subsequent exports will automatically contain them. If you want to see the entered values, just run the corresponding menu-entry. The currently set text is displayed in paranthesis only in the title-bar of the dialog. (Another shortcoming in the used Workbench:input method.) Simply press cancel to keep the original text.
The DATETIME issue was fixed by me long ago, but I forgot to post the new version, so 0.4 also contains this fix.
The other features are mostly based on the work of Antoine Noal, although I did some small improvements/corrections. Thanks again for your work, Antoine!
Download Link: MySQL Workbench Propel-Export Plugin v0.4
(Be sure to reload the file if it still shows the 0.3 version)
If you have questions regarding the new features or you find bugs / have suggestions, don’t hesitate to leave a comment!



Hy dhaas !
I have found a little bug. Mediumint is not converted to int by the plugin and propel does not understand it.
Except that, the v0.4 works fine with my schema and propel 1.2 integrated in symfony 1.0.
Great work.