在使用普通php和mysql的项目中 我有表app_users并且需要添加类型数组和默认值为空数组的列,我尝试:
ALTER TABLE app_users ADD setting_notification tinytext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:array)' DEFAULT 'a:0:{}'
有错误:
[SQL]ALTER TABLE app_users ADD setting_notification tinytext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:array)' DEFAULT 'a:0:{}'
[Err] 1101 - BLOB/TEXT column 'setting_notification' can't have a default value
如何更正为tinytest列添加默认值(如php的数组)?