[web2py] Re: Deploying DB

2011-04-29 Thread Anthony
As arguments to DAL, 'migrate' and 'migrate_enabled' do not do the same thing (the former sets the default for all define_table calls that lack an explicit 'migrate' argument, and the latter simply enables or disables all migrations), but they both default to True, so explicitly setting them as

[web2py] Re: Deploying DB

2011-04-29 Thread pbreit
If I do not have any migrate/fake_migrate parameters in any of my define_tables, do migrate/migrate_enabled and fake_migrate/fake_migrate_all work the same? I don't seem to be getting the same behavior. For example: db = DAL('sqlite://storage.sqlite', migrate_enabled=True, fake_migrate_all=Tru

[web2py] Re: Deploying DB

2011-04-26 Thread ron_m
The duplicate .table files from what I can tell come from using different database connection strings. I haven't looked for the code but I do know if I change the database type, user name etc in the DAL() connection string parameter it appears to generate a hash code from the string and prefix t

[web2py] Re: Deploying DB

2011-04-26 Thread pbreit
A new name might not be a bad idea both because fake_migrate isn't that clear and it does sound hacky. I've just rolled my database into production and have been struggling with migrations so any extra clarity would really help. It seems to me that something like "rebuild metadata" should be tr

[web2py] Re: Deploying DB

2011-04-26 Thread Anthony
On Tuesday, April 26, 2011 12:44:26 PM UTC-4, VP wrote: > > What I have issues with (perhaps wrongly) is the complication in > distinguishing migrate and fake_migrate. I'm not talking about where > it is used (in DAL(...) or in define_tables(...)). > > I think there's a logical thing in termin

[web2py] Re: Deploying DB

2011-04-26 Thread Oscar
I tried to use migrate_enabled but i having returned the following error: p4089 sS'key' p4090 S"'migrate_enabled'" p4091 sssS'traceback' p4092 S'Traceback (most recent call last):\n File "/home/dotcloud/current/ gluon/restricted.py", line 181, in restricted\nexec ccode in environment\n File

[web2py] Re: Deploying DB

2011-04-26 Thread VP
What I have issues with (perhaps wrongly) is the complication in distinguishing migrate and fake_migrate. I'm not talking about where it is used (in DAL(...) or in define_tables(...)). I think there's a logical thing in terminology that might needs to straighten up, whenever appropriate. On Apr

[web2py] Re: Deploying DB

2011-04-26 Thread Anthony
On Tuesday, April 26, 2011 11:42:03 AM UTC-4, VP wrote: > > > > On Apr 25, 5:09 pm, Massimo Di Pierro > wrote: > > this case you must run with > > > > DAL(,migrate_enabled=True, fake_migrate_enabled=True) > > > > Does DAL(,migrate_enabled=False, fake_migrate_enabled=True) work > ex

[web2py] Re: Deploying DB

2011-04-26 Thread VP
On Apr 25, 5:09 pm, Massimo Di Pierro wrote: > this case you must run with > > DAL(,migrate_enabled=True, fake_migrate_enabled=True) > Does DAL(,migrate_enabled=False, fake_migrate_enabled=True) work exactly the same as DAL(,migrate_enabled=True, fake_migrate_enabled=True)? I don't

[web2py] Re: Deploying DB

2011-04-26 Thread Oscar
So, If I don't use any argument at all, does Web2py set true as default? Oscar. On 26 abr, 08:23, Massimo Di Pierro wrote: > Than the safe way is: > > 1) delete database > 2) recreate database (empty, no tables) > 3 use > > DAL('mysql://...') # the default with no arguments like > migrate_ena

[web2py] Re: Deploying DB

2011-04-26 Thread Oscar
It applies for Postgre too? Oscar. On 26 abr, 08:23, Massimo Di Pierro wrote: > Than the safe way is: > > 1) delete database > 2) recreate database (empty, no tables) > 3 use > > DAL('mysql://...') # the default with no arguments like > migrate_enabled=True, fake_migrate_enabled=True > > On Ap

Re: [web2py] Re: Deploying DB

2011-04-26 Thread Gilson Filho
And how do I update the structure of the database in production? I can not delete it andcreate again. _ *Gilson Filho* *Web Developer http://gilsondev.com* 2011/4/26 Massimo Di Pierro > Than the safe way is: > > 1) delete database > 2) recreate datab

[web2py] Re: Deploying DB

2011-04-26 Thread Massimo Di Pierro
Than the safe way is: 1) delete database 2) recreate database (empty, no tables) 3 use DAL('mysql://...') # the default with no arguments like migrate_enabled=True, fake_migrate_enabled=True On Apr 26, 1:03 am, Oscar wrote: > Thank you for your reply, > > On 25 abr, 18:09, Massimo Di Pierro >

[web2py] Re: Deploying DB

2011-04-25 Thread Oscar
Thank you for your reply, On 25 abr, 18:09, Massimo Di Pierro wrote: > On a new database you should run at least once with migrate=True and > then you can set migrate=False and it should work. I did it, and didn't work. > If you are getting the errors below I assume you have migrate=True and >

[web2py] Re: Deploying DB

2011-04-25 Thread mart
nice! I searched the book, but couldn't find a reference to 'migrate_enabled'. Thanks for the info, will come in handy! :) On Apr 25, 8:20 pm, Anthony wrote: > On Monday, April 25, 2011 8:02:48 PM UTC-4, mart wrote: > > > Hi Massimo, > > > I have seen migrate=T/F, but not migrate_enabled=T/F > >

[web2py] Re: Deploying DB

2011-04-25 Thread Anthony
On Monday, April 25, 2011 8:02:48 PM UTC-4, mart wrote: > > Hi Massimo, > > I have seen migrate=T/F, but not migrate_enabled=T/F If you specify DAL(..., migrate_enabled=False), it will turn off all migrations, regardless of how the 'migrate' argument is set in individual tables -- so it's a

[web2py] Re: Deploying DB

2011-04-25 Thread pbreit
New in 1.95.1 as of today: https://groups.google.com/d/topic/web2py/oer8IeJ6dc8/discussion

[web2py] Re: Deploying DB

2011-04-25 Thread mart
Hi Massimo, I have seen migrate=T/F, but not migrate_enabled=T/F Is this new, or something PostgreSQL specific? Thanks, Mart :) On Apr 25, 6:09 pm, Massimo Di Pierro wrote: > On a new database you should run at least once with migrate=True and > then you can set migrate=False and it should wor

[web2py] Re: Deploying DB

2011-04-25 Thread Massimo Di Pierro
On a new database you should run at least once with migrate=True and then you can set migrate=False and it should work. If you are getting the errors below I assume you have migrate=True and missing database/*.table files. You must have deleted them. In this case you must run with DAL(,migra

[web2py] Re: Deploying DB

2011-04-25 Thread Oscar
Sorry again, The error is: ProgrammingError: relation "auth_user" already exists Oscar. On 25 abr, 16:34, Oscar wrote: > BTW I tried with migration set to False locally with SqLite and it > worked without issues. > > Oscar. > > On 25 abr, 16:32, Oscar wrote: > > > > > > > > > Hi there, > > >

[web2py] Re: Deploying DB

2011-04-25 Thread Oscar
BTW I tried with migration set to False locally with SqLite and it worked without issues. Oscar. On 25 abr, 16:32, Oscar wrote: > Hi there, > > I'm triying to deploy a W2P project based on Wiki_Plugin. I just > installed the plugin, I did some tests using sqlite, then I wanted to > deploy the c