I don't know if it's worth running a function on every request to check for model changes when presumably such changes will be relatively infrequent. Why not just manually run a migration whenever you make a change?
On Thursday, October 20, 2011 9:10:32 AM UTC-4, Cliff wrote: > > Anthony, thanks for the pointer. > > What I'm looking for is some hint about how I can check if the model > is at the latest and greatest level. > > Something like this: > > def some_function_to_see_if_we_need_to_migrate(): > ## code goes here > ## ?? > > migrate_enabled = some_function_to_see_if_we_need_to_migrate() > db=DAL(...migrate_enabled=migrate_enabled) > > Maybe the answer is in the sql.log file. > > Once I figure it out I'll share my answer. > > On Oct 20, 8:49 am, Anthony <[email protected]> wrote: > > db=DAL(..., migrate_enabled=True|False) enables or disables migrations > > completely, for the entire db. See the end of this > > section:http://web2py.com/book/default/chapter/06#Migrations. > > > > > > > > On Thursday, October 20, 2011 7:52:34 AM UTC-4, Cliff wrote: > > > > > I have migrate=False on my production server. > > > > > Any thoughts on the best way to toggle migrate to True, then > > > immediately back when upgrading the model? > > > > > As the application and user base grow I don't want to be manually > > > editing table defs every time I change the model.

