Question

Is it possible to generate model in Propel using Schema.xml, instead of Schema.yml?

There was once upon a time when xml was used for database generation in Propel, but it had been dropped in favor of yml. I should go for yml if I were handcoding my database schema, but now since I directly export my database schema from MySQL workbench using a plugin, and the result is in xml format, I have no choice but to work with xml.

Was it helpful?

Solution 2

I have found the answer: Just put your schema.xml in the folder where schema.yml is located and run the command line

php symfony propel:build-model

and you will be fine.

OTHER TIPS

I'm not using a yml file at all, because I don't use Symfony. In the folder contining my build.properties file, I run:

propel-gen ./ creole

That connexts to my database, reverse engineers it, and generates my schema.xml Then I just run:

propel-gen ./

That uses the schema.xml file to generate my models.

Just to clarify @lo_fye's answer, Propel has always used XML. It's Symfony that offered a YAML option, and even then you could use XML if you wished. Assuming you're using Symfony, it is just a question of popping in a schema.xml file rather than a schema.yml file.

FWIW, although XML schemas are slightly less readable, I prefer them. It feels a bit more solid, perhaps because I find the space thing in YAML fiddly.

Edit: ah, the last answer was from the OP - apols. Glad you fixed it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top