See my response on Stack Overflow: 
http://stackoverflow.com/a/26651810/440323
 

> Migrate is not the problem: it does not matter if I do 
> migrate_enabled=False or migrate_enabled=True.
> Besides, there is no table to migrate. That is the whole problem: 
> define_table does not create the table!
>

In web2py, "migrations" includes the initial creation of tables as well as 
subsequent modifications. 
 

> I am doing my own define_table because I have need to trigger some other 
> code whenever new users are created (not shown here)
>

If you show it, perhaps we can figure out how to do it by modifying the 
table definition after auth.define_tables() creates the table.
 

> Why does db.tables show that the table is created, when it is not? 
> (verified with pgadmin)
>

db.define_table() creates a dal.Table object, which is a Python object, not 
a database table. If you have migrations enabled and that table has not 
already been created in the database by web2py, then web2py will attempt to 
create the table in the database as well. Creation of the dal.Table object 
and creation of the actual table in the database are two different 
operations. The dal.Table object serves as the model that web2py uses to 
conduct operations on the database table -- it can exist independently of 
the existence of any actual database table. 

Anthony

-- 
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