Rangi Sutton schrieb:
> To clarify; I have a project up and running, and now I'd like to add a
> new column to a table. I add it to the tables class definition in
> model.py, but how do I get the database to update subsequently?

> Or do you just get your model right the first time!? Clever cats.

The way I handle is, that I create scripts that create and populate the
database with bootstrap data (using the SQLObject or SQLAlchemy API).
Then I can run these scripts each time I install the application
somewhere else.

Because these scripts are kept in sync with the structure of the model,
I don't need to mess around with the database structure directly, since
the database can always be created from scratch when I make changes to
the model.

This is also very handy for testing and, if you want, you can have these
 scripts run automatically after installation and on first start-up of
the application (for example via turbogears.startup.call_on_startup).


Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to