On Friday, January 29, 2016 at 2:11:38 AM UTC-8, Niphlod wrote:
>
> web2py doesn't do database introspection.
> it basically works like this.
>
> whooo, someone defined a table in the model..... are migrations turned on 
> ? 
> if yes
>      is there a corresponding .table file ?
>            if yes
>                inspect the file and see if it matches table definition
>                if matches table definition ?
>                    don't do anything
>                if not mathes table definition alter the table accordingly
>           if not
>                 go ahead and create the table
> if not
>     don't do anything
>
> so..... migrations turned on, tables created on the database.... you drop 
> .table files --> web2py assumes it has to recreate those.
> to fix the issue, set fake_migrate_all, which instructs web2py to do 
> nothing on the backend and just recreate .table files.
> then set fake_migrate_all=False and continue to play with the database.
> once in production with no further playing with models, just set 
> migrate=False. 
>
>
>

I've put a star on this one for my own use, as I think it's the best 
explanation I've seen yet.

 /dps


> On Friday, January 29, 2016 at 9:27:57 AM UTC+1, Tom Campbell wrote:
>>
>> App is on pythonanywhere, using Postgres. Connect string is:
>>
>>     db = DAL('postgres://
>> web2pydbadmin:mypassw...@memberable-96.postgres.pythonanywhere-services.com:10096/mydatabase
>> ')
>>
>> Existing topics like 
>> https://groups.google.com/forum/#!topic/web2py/p740UJkR3Ao do not seem 
>> to have helpful info.
>>
>> I admit I lost my temper and deleted everything in /databases out of 
>> range and frustration (and the same error appears). I figured web2py would 
>> just rebuild tables if necessary.
>>
>> I seem to be an absolutely shit database administrator (gave up on GAE 
>> altogether) and would be happy to hire someone who has experienced this 
>> problem using postgresql on pythonanywhere.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to