On Mon, Nov 24, 2008 at 9:04 AM, Florent Aide <[EMAIL PROTECTED]> wrote: > > On Mon, Nov 24, 2008 at 3:15 PM, Antony Joseph <[EMAIL PROTECTED]> wrote: >> Hi, >> >> In turbogears application, i want to know that how can i update the >> devdata.sqlite, if there is any modification or new tables added in database >> schema. >> currently i am using tg-admin sql create to create a new devdata.sqlite and >> replace the existing devdata.sqlite, Every time i am losing my data when >> database has changes. >> >> Can anyone help me how to update my existing devdata.sqlite. > > If you are using SQLAlchemy, sqlalchemy-migrate is what you need. It > will work better with postgresql or mysql because sqlite misses some > table delete commands (but basic migration will work with sqlite too, > you just won't be able to downgrade your database schema).
keep in miind that for that solution you need pre and post update models. the other approach for this is to do it "manually" you will code alter table statements, then update your code then make sure both works. and the last one is to just get a new db and do export/import of the data into the new model. You should also note that adding new tables should be a problem but modifying is. > > If you use SQLObject you're on you own, I don't have an answer. > the two approaches up there work for your use case. > Florent. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

