sophana wrote: > Ilias Lazaridis a écrit : >> Oleg Broytmann wrote: >> >>> On Sun, Sep 24, 2006 at 12:03:04AM +0200, sophana wrote: >>> >>>> Here is my (very small) contribution to sqlobject, that I find very cool >>>> to program with. >>>> >> ... >> >> >>> With all those print's this >>> >>> >>>> def updateSchema(self, doIt=False, connection=None): >>>> >>> looks like a debugging procedure... >>> >>> Oleg. >>> >> shouldn't this be used by the team? >> >> I mean, it's a _very_ important functionality. >> >> . >> >> > It's true that it helps a lot when upgrading the schema. > I don't understand why it was not in SqlObject before. > I tried to use sqlObjectAdmin but I couldn't even find this > functionality which fits in so few lines of code.
I had provided a similar solution for the django orm layer: http://case.lazaridis.com/browser/django/rework/evolve.py but that was not integrated. > To resume what it does, it compares the columns in the object and in the > database. > It deletes all columns that are not in the SqlObject declaration, and > add missing ones to the database. > > It suffers from default values not being set correctly because _extraSQL > method in col.py that does not add default values. > Default values are important when upgrading a schema... would this be much effort to add this? what do you think? > When you don't set doIt to True, the method only tells what it is going > to do. > This is important if you don't want a column to be deleted by accident... . -- http://lazaridis.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss