propelorm/propelorm.github.com — pull request #91 by pmarking (2012-01-08 04:39:31+00:00)
Title: Update documentation/10-migrations.markdown

As per issue #251, submitting pull request adding instructions for final step of migration process--generating the new object model.

This adds text to two places:
1. adds a fifth step to the short list of steps
2. adds the fifth step to the concrete example below the short list

https://github.com/propelorm/Propel/issues/251#issuecomment-3395513

Original text from issue #251 below:

If I needed to make a change to the database, for example add a column to a table, the current documentation says to do the following:

1. Modify the database schema in the schema.xml file.
2. Run 'propel-gen diff' to generate the migration file/class.
3. Edit the migration file/class, if necessary.
4. Run 'propel-gen migrate' to apply the changes to the database.

However, if I only do those steps, my object model will be out of sync with the schema and will still have no knowledge of the new column (this would be even worse if I wanted to remove a column from the schema, in which case queries still using that old column would actually fail and bring my site to a halt).

That said, I'm pretty sure that the "missing 5th step" should be:

(5) Run 'propel-gen om' to generate the updated object model classes.

(Note: I specified 'propel-gen om' and not the "triple-action" command of just 'propel-gen' without any parameters, because we specifically do not want to regenerate the sql file, and we also have no need to reconvert the runtime configuration file since that wouldn't have changed.)