We have the same (similar) issue using mssql on Windows: when we get a pyodbc.ProgrammingError typically relating to a foreign key, we have to restart web2py.
This is particularly frustrating problem as these errors happen every time you rename/delete a column with a foreign key.
E.g. create a field that references another table:
.....
Field('a_field', db.another_table, ondelete='CASCADE'),
....
Then remove/rename ;a_field', and you get "ALTER TABLE DROP COLUMN a_field failed because one or more objects access this column."
This causes web2py to hang, so we have to go into management studio, delete the constraint, and restart web2py because it has become unresponsive.
I think that, aside from resolving why web2py hangs, we could also improve migration so that it deletes any constraints automatically when we drop a column.
While we're at it, web2py could check a column actually exists before calling a DROP statement. It frequently happens that things do get out of synch with fake migrates and manually modifying the table etc, and for a DROP statement to be called on a column that has been removed. There is really no benefit in web2py failing if the column to delete isn't found.
I thought I'd reply to this thread (ps: right thing to do?) and see if anyone had any suggestions/info before I go raising as bugs/features, or attempting to produce a patch...
--
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/yaW04rGM-gY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.