Export MySQL Workbench data model directly to Schema YML in Propel/ Symfony
Asked Answered
M

4

9

Is there any plugin that directly exports MYSQL Workbench data model directly to YML for Propel consumption?

Mythologize answered 1/3, 2009 at 9:47 Comment(0)
S
10

Yes, MySQL Workbench Plugins are available for generating schemas for Propel, Doctrine, Symfony, etc

http://forums.mysql.com/read.php?153,208229

Stripper answered 1/3, 2009 at 21:38 Comment(1)
Thanks, I didn't realize that the plugin for Propel and Symfony, as far as MySQL workbench is concenred, are different when I did google searches for this. This is my fault, and hence I change the question of this title so that other people who are in my same shoe can benefit from thisMythologize
P
2

Just an update on this issue. If you are looking for a quick and convenient way to export your database tables to entities and mapping .yml files, there used to be a plugin for Workbench that would do this, but this LUA is not supported any more, unfortunately. It worked great -- too bad because if you use MySQL Workbench, a plugin would ideally be the most convenient and fastest way to export your database as entities into your Symfony project.

So, the next best solution I found is installing a utility that can be executed from Symfony's app/console called "mysqlworkbenchschemaexporter". With this utility, you will have to save your Workbench files (*.wmb) then upload them to a folder, then the following app/console commands are available:

app/console mysqlworkbenchschemaexporter:dump
app/console mysqlworkbenchschemaexporter:withRepository

Without buying an ORM tool like Skipper, which costs over $300, I did find this recently updated solution that is supported at:

https://github.com/turnaev/mysql-workbench-schema-exporter-symfony2-bundle

I hope this helps other Symfony developers save some time with entity creation and ORM mappings!

Pixie answered 22/3, 2015 at 18:15 Comment(0)
D
0

If export from MySQL workbench isn't sufficient, you can try our tool Skipper - formerly ORM Designer (I'm chief developer). With Skipper you can define and export also behaviours, Propel specific column/table/... attributes and much more.

http://www.skipper18.com

Doubs answered 27/4, 2010 at 9:7 Comment(1)
I am a fan of Skipper, it helped with my Symfony ORM mappings, definitely saves time for devs, especially on bigger projects.Pixie
A
0

When using symfony 1.x, personally I prefer the following process:

  1. design the model with workbench
  2. use the "synchronize model" option to apply changes to the DB
  3. run the propel:build-schema task to update the schema.yml
  4. run the propel:build --all-classes task (it implies model, forms and filters)

Please note: step 3 will overwrite your entire schema.yml file. If you need to add special tweaks to it, just add a schema.custom.yml to your project and you're good to go.

Abhorrent answered 2/8, 2013 at 14:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.