Hi - Thanks for the response.

I did find the documentation and set migrate=False and was able to get it 
working.

However, the follow up question is, what to do if I do want to change the 
tables? EG: What if I want to add a new field.

It seems that I'm now locked out of making changes on both ends.

FWIW, the migrate documentation is not as clear as it could be and the 
pydal information could use a section on how to interact between pydal and 
web2py (I assume that most others are using it to do this but maybe not?)

I guess that (once I get it figured out) I should take it upon myself to 
suggest the changes - could be a great 1st commit ;-)

Tom

On Sunday, January 18, 2015 at 5:27:33 AM UTC-8, Niphlod wrote:
>
> if it exist already you don't need .table at all. just set migrate=False.
>
> .table files are web2py way of tracking what is supposed to be already in 
> the database for two reasons:
> - if you define a table that doesn't exist, create it
> - if you changed the definition of a table (e.g. added a field), adjust 
> what is yet in db to match the current model
>
> web2py doesn't do introspection automatically (doesn't know ANYTHING about 
> what is in the database already) and doesn't want to. You either start 
> "fresh" with no .table and let migrate=True work (default behaviour) or you 
> start with something in it and set migrate=False to turn off the entire 
> machinery.
>
> It's not all black or white, though. The "grey" consinst in you defining a 
> model for all existing tables (i.e. migrating an app TO web2py, with a 
> yet-existing database) and start "fresh" by setting migrate=True and 
> fake_migrate_all=True, with the latter turned on just for a single request. 
> In that single request, web2py will re-create .table files from your 
> current model. Later on, when you'll alter that definition, it'll keep your 
> database tables in sync with your model. 
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to