it seems that you updated also the databases folder of your production app 
or ... dunno. 
I don't see why so many peoples are running into this kind of errors (there 
are others intricacies but adding column ISN'T one of them). What DAL does 
with migration is pretty documented and understandable...

steps to live happily: 
- run production with migrate=False
- run test with migrate=True
- make change to test model
- test eveything is ok
- apply changes to model also in production, with migrate=True. Hit 
appadmin (manage database in the admin app) to be sure all migrations are 
triggered. you can see the commands issued on databases/sql.log
- turn back to migrate=False in production

steps to recover from your situation (maybe):
- revert to old model in production
- set migrate=True, fake_migrate_all=True in production
- hit appadmin on prod, let web2py recreate .table files according to the 
old model
- set migrate=True, fake_migrate_all=False in prod
- change model in production
- hit appadmin to let web2py issue ddl statements to the database, inspect 
sql.log for commands issued
- set migrate=False in production

On Friday, June 5, 2015 at 8:00:18 PM UTC+2, Julien Courteau wrote:
>
> Hello,
>
> (1) I use sqlite
>
> (2) In development I made the following change to a given table:
> db.define_table(...
>     Field('description', 'text'),
> ...
> ) 
> becomes:
> db.define_table(...
>     Field('description_en', 'text'),
>     Field('description_fr', 'text'),
> ...
> ) 
> Everything went well.
>
> (3) Then I tried to apply the same changes to the production database and 
> it gave me the
> error: "column description_en does not exist" when the application try to 
> access the table.
> The migration did not occur. The database still has only the description 
> field in it.
>
> (4) I tried to get rid of the table files (migration files from the 
> databases folder) related to that table
> without success ("table does not exist")
>
> (5) I tried to get rid of my changes in the models file and use:
> db_es = DAL('sqlite://estore.db', fake_migrate_all=True) and then
> reapply my changes with db_es = DAL('sqlite://estore.db', migrate=True)
> with the same error ("description_en does not exist")
>
> Please, how could I solve that problem?
>
> Thanks!
>

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