| [performance] propel-build-sql VS propel-build-schema [message #31511] |
Mon, 16 July 2007 15:50  |
machado Messages: 7 Registered: July 2007 |
Junior Member |
|
|
Hello,
Despite I've already coded some web apps in PHP, I'm fairly new to Symfony.
Till now, I've been following this approach:
1.UML design
2.DB design (with SQL database script coding)
3.PHP coding
Now I'm reading the book about symfony and it replaces the 2nd point (DB design) by coding a schema.yml that will translate to a DB script using the command propel-build-sql.
In the end of chapter 8, there's a brief reference to the command propel-build-schema that will reverse the process: it access the DB and creates a schema.yml file that translates the table structure of the DB.
So we can have 2 scenarios:
Scen.1:
Write schema.yml (xml)
Call propel-build-model
Call propel-build-sql
Run the SQL script in order to create the DB structure
Scen.2:
Write SQL script
Run SQL script in order to create the DB structure
Call propel-build-schema
Call prople-build-model
My question is: what scenario is the most efficient to get things done if we are starting a brand-new project?
Thank you for your answer.
|
|
|
| Re: [performance] propel-build-sql VS propel-build-schema [message #31545 is a reply to message #31511 ] |
Tue, 17 July 2007 00:13  |
LuxAeterna Messages: 88 Registered: June 2007 Location: Copenhagen |
Member |
|
|
Hi machado
Correction: You don't have to write the SQL script in scen. 2. You just create the database - for example, for MySQL, you could use PHPMyAdmin for this. Then you call propel-build-schema, and it will generate the schema file from your database directly.
So which method is better? I don't think one is faster than the other. You have the options for flexibility. I personally started my project by writing the schema file and build the database and model from this. When making corrections, the schema file gives a good overview and is easier to manage.
|
|
|