> I am a little newish to TG... I had been using 0.8 for a small project. > I am finding myself wanting to add a few new columns to the sql objects > I have already created. Is there and elegant way to accomplish this?
No, there isn't such a beast right now. SQLObject does have the beginnings of support for changing model.py and updating the underlying database (if the db supports it--sqlite, for example, has very limited ALTER TABLE support), but it's broken right now (see http://trac.turbogears.org/turbogears/ticket/458). Personally, I've had bad experiences expecting tg-admin sql [drop|create] to do the right thing with an altered schema, so I do this: 1. Shut down the TG app 2. Dump the db to a file 3. Clear the db (in development I use sqlite, so it's just an rm) 4. Update model.py 5. Run tg-admin sql create 6. If necessary, write a small script to "fix up" the dump file 7. Bulk-load the dumped data 8. Start the TG app Right now, I do 6) in sql. What would be nice is to eliminate 3) by creating the new schema in a new model.py, copying from one to the other (keeping connections separate via namespaces), then replacing the old model.py. Primary key consistency and generated columns (like timestamps) are always tricky in these cases, though. -- Tim Lesher <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

