Ticket #536 (fixed bug)
Default value for table column
- Created: 2011-11-10 06:53:47
- Reported by: daris
- Assigned to: Franz
- Milestone: 2.0-alpha1
- Component: database
- Priority: normal
Setting '' as default value for column should assign a '' (empty string) value instead of null
$query->field('search_for', Flux_Database_Query_Helper_TableColumn::TYPE_VARCHAR(60), '', false);
`search_for` varchar(60) NOT NULL DEFAULT NULL,
`search_for` varchar(60) NOT NULL DEFAULT '',
Also, setting 0 as a default value (without quotes), sets the null for the column (when it should be 0). It's not the new dblayer issue, but it's a PDO related problem. Is it worth doing a workaround for this?
also: we should definitely not require the coder to call $db->quote() on a default value that he passes to that query class.
Franz 2011-11-17 23:38:06
I've almost got this, just struggling with PostgreSQL at the moment. Once I'm done and have it pushed, can you update the install script this once more?
daris 2011-11-18 07:19:11
I can, no problem
Franz 2011-11-23 00:40:47
- Status changed from open to fixed.
Should be done now. Even the default values that the tableInfo() function spits out, are quite nice.