Is it somehow possible to automatically generate a YAML schema file or models from an existing MySQL database?
I need to create models for Doctrine but writing the model classes manually seems extremely boring to me. I already have MySQL database with tables and all relations so it would help me if there is some way to generate Doctrine models from it.
If you are using doctrine 2:
http://www.doctrine-project.org/docs/orm/2.0/en/reference/tools.html#reverse-engineering
Yes, it is possible ;-)
For Doctrine 1.2, take a look at the Command Line Interface : amongst other utilities, you have the possibity to generate the YAML files from an existing database.
And, for Doctrine 2.0, you'll want to take a look at Reverse Engineering
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With