austgl / mysql-workbench-doctrine-plugin

Automatically exported from code.google.com/p/mysql-workbench-doctrine-plugin
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Convert 'User Types' via mysql types to doctrine types #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In 0.4.1, 'User Types' get written as

unsupported simpleType XX

in the yaml file. This renders the file unusable.

I suggest the following changes/enhancements:

1. convert 'User Types' to the corresponding mysql type, and then to
Doctrine types;
2. take one of the absolutely weird mysql types for declaring 'custom
Doctrine Types' as 'User Types' - I'm surely not the only one having
patched Doctrine 1.2 for custom types.

Example:
userType1 = TINYINT
userType2 = MULTIPOLYGON (defined as 'special' type)

column w/ userType1 -> TINYINT -> integer(1)
column w/ userType2 -> userType2 -> userType2

Original issue reported on code.google.com by hpoeri@gmail.com on 4 Feb 2010 at 2:15

GoogleCodeExporter commented 9 years ago
I'm not sure what you mean. Currently we already cast TINYINT to integer(1).

MULTIPOLYGAN is not supported by doctrine - as far as I know and I'm also not
familiar with the concept of userTypes.

We could ignore the userTypes or bypass them directly to the yaml, as it would 
be the
same effect on non-patched systems as adding the message "unsupported 
simpleType xx".

Original comment by johannes...@gmail.com on 4 Feb 2010 at 10:50

GoogleCodeExporter commented 9 years ago
The current version tries to convert 'userType1' directly to a doctrine type - 
which
is bound to fail. What was probably intended (and what I described under 1.) is 
that
'userType1' is converted to TINYINT, which then can be converted to a doctrine 
type.

As for 2, I would suggest declaring one special type... Such that one still can 
catch
errors.

Find attached a small diff. Please bear with me, as I don't really know Lua 
syntax...

Original comment by hpoeri@gmail.com on 5 Feb 2010 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
merged your patch partially to trunk and started new 0.4.2 version.

Thanks for your help and feel welcome to add more patches.

Original comment by johannes...@gmail.com on 6 Feb 2010 at 11:23