Try the following:
1. backup databases dir
2. remove all files from databases dir
3. db = DAL(...., fake_migrate_all=True, migrate=False) ## no real
migrations on the database just recreating metadata in databases dir
4. python web2py.py -M -S <yourapp>
5. exit from python shell
6. add new tables in your models make sure each on of them has migrate=True
as last argument in db.define_table(..., migrate=True)
7. db = DAL(...., fake_migrate_all=False, migrate=False,
migrate_enable=True)
8. python web2py.py -M -S <yourapp>
9. >>> db(db.<yournewtable>).count() ## if this works you are ok
10. exit from python shell
11. change all migrate=True to migrate=False in your models:
db.define_table(..., migrate=False)



2013/10/13 david.waldrop <[email protected]>

> I have an existing web2py application to which i need to add several
> tables.
> I defined the tables but they are not getting created in the Postgres
> database.
> I reread the book on migrating and ended up trying fake_migrate_all and
> now have the .table files in the database directory but still no tables in
> the database.
> Anyone have any ideas how I can ge these tables created in the database?
>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to