Ucenter和Discuz! X2解决用户名长度限制需修改数据库字段汇总
在新发布的Discuz!X 2中,系统默认的用户名长度限制仍然是3-15字节,但有一些网站可能会因为各种原因需要将用户名长度的限制做一些修改。现整理了这篇Ucenter和Discuz! X2解决用户名长度限制需修改数据库字段汇总信息。
要小心,如果数据库中已有数据就需要更加小心处理了。
首先,修改UCenter库表pre_ucenter(pre_为自定义前缀,下同):
1 2 3 4 5 6 7 8 9 |
pre_admins:username[char(50)] pre_feeds:username[varchar(50)] pre_members:username[char(50)] pre_mergemembers:username[char(50)] pre_protectedmembers:username[char(50)] |
然后,修改Discuz!X库表pre_ultrax:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
pre_common_adminnote:admin[varchar(50)] pre_common_banned:admin[varchar(50)] pre_common_card_log:username[varchar(50)] pre_common_diy_data:username[varchar(50)] pre_common_failedlogin:username[char(50)] pre_common_grouppm:author[varchar(50)] pre_common_invite:fusername[varchar(50)] pre_common_member:username[char(50)] pre_common_member_validate:admin[varchar(50)] pre_common_member_verify_info:username[varchar(50)] pre_common_mytask:username[char(50)] pre_common_report:username[varchar(50)],opname[varchar(50)] pre_common_session:username[char(50)] pre_common_word:admin[varchar(50)] pre_forum_announcement:author[varchar(50)] pre_forum_forumrecommend:author[varchar(50)] pre_forum_groupuser:username[char(50)] pre_forum_order:admin[varchar(50)] pre_forum_pollvoter:username[char(50)] pre_forum_promotion:username[char(50)] pre_forum_post:author[varchar(50)] pre_forum_postcomment:author[varchar(50)] pre_forum_ratelog:username[char(50)] pre_forum_rsscache:author[varchar(50)] pre_forum_thread:author[varchar(50)] pre_forum_threadmod:username[char(50)] pre_forum_trade:seller[varchar(50)] pre_forum_tradecomment:rater[varchar(50)] pre_forum_tradelog:seller[varchar(50)],buyer[varchar(50)] pre_forum_warning:operator[varchar(50)],author[varchar(50)] pre_home_album:username[varchar(50)] pre_home_blog:username[varchar(50)] pre_home_clickuser:username[varchar(50)] pre_home_comment:author[varchar(50)] pre_home_docomment:username[varchar(50)] pre_home_doing:username[varchar(50)] pre_home_feed:username[varchar(50)] pre_home_feed_app:username[varchar(50)] pre_home_friend:fusername[varchar(50)] pre_home_friend_request:fusername[char(50)] pre_home_notification:author[varchar(50)] pre_home_pic:username[varchar(50)] pre_home_poke:fromusername[varchar(50)] pre_home_share:username[varchar(50)] pre_home_show:username[varchar(50)] pre_home_specialuser:username[varchar(50)],opusername[varchar(50)] pre_home_visitor:vusername[varchar(50)] pre_myrepeats:username[varchar(50)] pre_portal_rsscache:author[varchar(50)] pre_portal_topic_pic:username[varchar(50)] |
从Discuz! X1.5升级到Discuz! X2的升级程序会自动检查和更新数据库,需要修改网站/install/data/目录下的install.sql文件,文件内容都是SQL语句,注意修改以上所列数据库表及字段。