Our user Yannick discovered a problem.

In web2py reference fields for MySQL are defined as "INT NOT NULL".
The "NOT NULL" appears only for MySQL and thus causes it to behave
differently than any other database.

This should be considered a bug but changing it would break backward
compatibility.

I found a solution which I have posted to trunk:

I changed the translation of web2py reference fields in MySQL but
prevented the change from causing a migration. This means that since
web2py 1.58 MySQL will behave properly. If you have a MySQL table
created with web2py 1.57 or earlier you are stuck with a problem that
you cannot insert NULL values into a reference field (and for example
Auth does not work).

In this latter case web2py will not migrate the field for you but you
can manually alter the table and redefine the ID column as an INT,
instead of a INT NOT NULL.

Hope this makes sense.

Sorry about this.

Massimo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to