Is there any plugin that directly exports MYSQL Workbench data model directly to YML for Propel consumption?
Yes, MySQL Workbench Plugins are available for generating schemas for Propel, Doctrine, Symfony, etc
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!
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.
When using symfony 1.x, personally I prefer the following process:
- design the model with workbench
- use the "synchronize model" option to apply changes to the DB
- run the propel:build-schema task to update the schema.yml
- 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.
© 2022 - 2024 — McMap. All rights reserved.