Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-13 Thread Niphlod
that call to appadmin is the same I recommended to "hit" manually. it's the only controller that loads EVERY module, even if it's conditional... It's a smart usage of cmdline though :-P On Saturday, April 11, 2015 at 9:46:39 AM UTC+2, Pablo Angulo wrote: > > > -BEGIN PGP SIGNED MES

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-11 Thread Pablo Angulo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 09/04/15 a las 10:21, Niphlod escribió: > another "caveat circumvented", another step in the good direction now the > problem is only IF you have conditional models. I tried this and it triggered the migration on a conditional model: python

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-09 Thread Niphlod
another "caveat circumvented", another step in the good direction now the problem is only IF you have conditional models. On Thursday, April 9, 2015 at 10:01:17 AM UTC+2, Pablo Angulo wrote: > > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > El 08/04/15 a las 20:58, Niphlod escribió:

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-09 Thread Pablo Angulo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 08/04/15 a las 20:58, Niphlod escribió: > good too, but NEEDS to happen without lazy_tables ^_^ This is what I do: db = DAL('mysql://web2pyuser:pass@localhost/database', migrate=migrate, lazy_tables=(not migrate)) -BEGIN PGP SIGNATURE- Ve

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-08 Thread Niphlod
good too, but NEEDS to happen without lazy_tables ^_^ On Wednesday, April 8, 2015 at 9:42:25 AM UTC+2, mcm wrote: > > The following is a trick that gives little overhead and make migration > happen when needed. > > python web2py.py -S your_app -M -R script.py -A --do-migrate > > script.py can be

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-08 Thread Michele Comitini
The following is a trick that gives little overhead and make migration happen when needed. python web2py.py -S your_app -M -R script.py -A --do-migrate script.py can be empty or do anything you like... then in db.py import sys if '--do-migrate' in sys.args: do_migrate = True else: do_migrat

[web2py] Re: Triggering a one-time migration when schema changes

2015-04-07 Thread pang
El martes, 7 de abril de 2015, 17:53:14 (UTC+2), Niphlod escribió: > > When you need it, set migrate=True, hit appadmin one time to let the > migration happen, then set it to False. > How about using python web2py.py -S your_app -M instead of hitting appadmin? The reason is that I disable the a

[web2py] Re: Triggering a one-time migration when schema changes

2015-04-07 Thread Niphlod
don't ever set migrate=True if not on the development server. When you need it, set migrate=True, hit appadmin one time to let the migration happen, then set it to False. No need to waste CPU or I/O if you're in complete control of when migrations need to happen. -- Resources: - http://web2py