rebuilding the db schema

1 - update config/schema.yml

2 - "php symfony propel:build-sql" from the command line, that will build the correct propel crap from the schema.yml

3 - now, here you should be able to just run "php symfony propel:insert-sql" but I always get a [wrapped: invalid data source name] error that I have no idea what it means, so you can also do:

> mysqladmin -u root -p create DB_NAME
> mysql -u root -p DB_NAME < data/sql/lib.model.schema.sql

obviously you don't have to do the "mysqladmin" command if you have already created the db, and you don't have to worry about the -p (password) if your localhost root has no password. You can also open the XAMPP phpAdmin and import the lib.model.schema.sql file into your db that way.

4 - then, if you changed your schema you will want your model bases to reflect the change, so delete the cache (delete everything in the cache folder) and then run: "php symfony propel:build-all" to rebuild everything, the documentation says to use "php symfony propel:build-model" but that doesn't redo all the base* classes of the model

I got all this from the middle and bottomish part of http://www.symfony-project.org/book/1_2/08-Inside-the-Model-Layer

propel:data-load in ch16 will also let you import data from a text file, to populate your db

To just rebuild the sql and the classes:

php symfony propel:build-sql
php symfony propel:build-all --classes-only
Feedback