> RE bug reports: there is also google code to post bug reports to: http://code.google.com/p/web2py/issues/list i know that at times things get backed up, and occasionally a bug gets missed, which is why we have been encouraged to start using the google code bug tracking.

I´d rather post it here first and when it is confirmed to be a bug report it att Google code. Reason being that everytime it is not a bug but a mistake made by user.

>  it does not delete fields from the database

It does delete fields from database. If I define a Field in my models file and then remove that Field definition the field is deleted from database. I just tested it. But DAL does not remove an extra fields. So if you by hand go att add fields DAL does not remove them. I guess that means that it does not either know how to use those extra fields.

When I looked closer att my extra field in the table I´m pretty sure I know what happened.

One field was a reference to an order field in an other table, meaning foreign key in MySQL. At some point a decided to remove that field so I commented it out from my models file. This gives an error as you can´t remove a foreign key just like that in MySQL, meaning web2py throws an error at me. So I backuped my database, dropped it and removed all files in /databases/. Created the database and web2py created all empty tables, with that reference field removed. Then I restored the backup to get all data back. At that point I think MySQL even restored that reference field. But as web2py thinks that field is removed it does not try to remove it anymore and everything works, I just have an extra field in my table. Only time it can be a problem if I try to add a field with the same name.


Kenneth



, and changing types and certain restrictions it won't be able to update all by itself. as you get into the more complex migrations (ones where web2py doesn't know how to transform the data) you will have to write SQL by hand to do it. for my most complex projects i do all of my migrations manually. if you notice areas where the migration can be generalized i'm sure massimo would consider a patch.

good luck!

christian

Reply via email to