You could do something like this: DEVMODE = request.is_local db = DAL(..., migrate_enabled=DEVMODE)
When the migrate_enabled argument to DAL() is set to False, all migrations are disabled (regardless of the 'migrate' setting for each individual define_table() call). You can either change it manually on production, or use some test to determine whether the app is running in the production environment (the above example turns migrations on only when the request is from the local machine). Anthony On Thursday, October 6, 2011 3:34:50 AM UTC-4, guruyaya wrote: > > Let me start by saying that I LOVE migrations. It makes development so > much easier. For me, it's the number 1 web2py killer feature: the fact > I don't have to think of databses while developing. > But in a production enviroment, migrations takes time and reasources. > I wouldn't want to run migration on each request. So with every > production change, I have to turn on migrations, go over my apps, and > then turn it off. > Is there a way to make migrations run from a script, even if migration > is set to false? > Thanks in advance > Yair

