Closed ghost closed 13 years ago
This line is different from the one in the develop branch, so I have to assume it's has already been fixed.
Do you know of anything addressing the issue with the ORM and null values?
There is no issue in the fuel/orm issue list regarding null values. If there is, please create an issue there.
According to the docs, specifically at: http://fuelphp.com/docs/classes/database/dbutil.html#method_create_table
When specifying whether a field can be null, it states "boolean, true if nullable, defaults to false". This however is not the case. Unless you specify it not to allow null, the fields will allow it.
The fix:
$sql .= array_key_exists('NULL', $attr) ? (($attr['NULL'] === true) ? ' NULL' : ' NOT NULL') : '';
becomes:$sql .= array_key_exists('NULL', $attr) ? (($attr['NULL'] === true) ? ' NULL' : ' NOT NULL') : ' NOT NULL';
Line 176 of /fuel/core/classes/dbutil.php from the latest RC.
Perhaps I just misunderstood what the docs said, but it seems like that should be the functionality.
Additionally, when utilizing the ORM and having NOT NULL available, it seems that I get a "Column cannot be null" error when using empty values, as the ORM seems to attempt to set it as NULL when really I just meant blank.
Hopefully we can all figure something out ;)