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

Custom actAs for table #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Johannes,

First thanks for this great contribution to the doctrine community. I'll 
definitely contribute if I get some opportunity.

I was wondering if there was any way of adding custom actAs (timestampable, 
sluggable, GoogleI18n...) for a table using WB ?

Thanks,

Antoine

Original issue reported on code.google.com by antoine....@gmail.com on 11 Nov 2009 at 1:40

GoogleCodeExporter commented 9 years ago
Hi Antoine,

thank you for your post - you're welcome.

Unfortunately MySQL Workbench has no idea of behaviours as this is related to
doctrine and not to MySQL.

As I implemented the *_ns table names (as you may plead) this was just for my
personal purpose, but this isn't a solution for behaviours in general, because 
you
can combine behaviours and/or nest them which is impossible to implement by 
adding
small pieces like *_ns.

Johannes

Original comment by johannes...@gmail.com on 14 Nov 2009 at 11:18

GoogleCodeExporter commented 9 years ago
Hi Johannes,

Thanks for your quick reply.

You're completely right about the behaviours. Therefore, I'm wondering if 
implementing a 
specific syntax for the tables comments would be a good idea.

We could use something like the following directly in the tables comment fields:
{doctrine}
  actAs:
    Timestampable:
{/doctrine}

It's kind of a hack and for sure not standard in WB, but this may bring 
developers (like me / 
us) relying only on the graphical schema when updating their database structure 
and doctrine 
behaviors, rather than having to implement specific hacks on the Doctrine side.

What do you think ?

Antoine

Original comment by antoine....@gmail.com on 14 Nov 2009 at 11:46

GoogleCodeExporter commented 9 years ago
please check this version of the plugin and tell me if this works for you.

add the following structure to your table comment:

{doctrine:actAs}
  actAs:
    Timestampable:
    NestedSet:
      ..
{/doctrine:actAs}

Please keep an eye on the spaces - the "actAs:" line has 2 leading spaces.

Johannes

Original comment by johannes...@gmail.com on 14 Nov 2009 at 1:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Johannes,

That was fast ! I just had the time to install wb & the doctrine plugin on my 
home pc.

Your update seems to work just fine for me. I think it's worth publishing &
documenting it.

Tell me if I can be of any help.

Antoine

Original comment by antoine....@gmail.com on 14 Nov 2009 at 6:53

GoogleCodeExporter commented 9 years ago
feature uploaded to SVN

Original comment by johannes...@gmail.com on 15 Nov 2009 at 11:13

GoogleCodeExporter commented 9 years ago
Thanks !

Original comment by antoine....@gmail.com on 15 Nov 2009 at 12:39

GoogleCodeExporter commented 9 years ago

Original comment by johannes...@gmail.com on 17 Nov 2009 at 9:47