Summary:
Can't set string 'default' for default value in method.install.php.
Detailed Description:
When I do this (in method.install.php in module):
$flds = "
obj_id I KEY AUTOINCREMENT,
sort_fix I(1),
sort_type C(10) DEFAULT 'default',
sort_field C(150),
sort_dir C(5),
sort_field_type C(7) DEFAULT 'default',
active I(1),
obj_tpl I(1)
";
$sqlarray = $dict->CreateTableSQL(GR_TABLE_OBJECTTYPES, $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
debug show me this:
(mysql): CREATE TABLE cms_module_grealty_object_types (
obj_id INTEGER NOT NULL AUTO_INCREMENT,
sort_fix INTEGER(1),
sort_type VARCHAR(10),
C 150 DEFAULT 'sort_field',
sort_dir VARCHAR(5),
sort_field_type VARCHAR(7),
I 1 DEFAULT 'active',
obj_tpl INTEGER(1),
PRIMARY KEY (obj_id)
)ENGINE=MyISAM
Error (1064): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '150
DEFAULT 'sort_field',....
I solved this like this
in file /lib/adodb_lite/adodb-datadict.inc.php in function _GenFields in string
515 ( after "foreach($f0 as $token) {" ) I insert strings:
if ($hasparam) {
$f1[$hasparam] = $token;
$hasparam = false;
continue;
}
Now i can set string 'default' for default value in database field.