从 Discuz! 老版本升级到 Discuz! X2 的时候,必须把 Ucenter 升级到 1.6 版本。
在升级 Ucenter 的时候,由于要对短信息表进行操作,数据量很大的同学往往会觉得升级时间过长,甚至有时候还卡住不动了。
由于 Ucenter 到 1.6 的升级主要是操作数据库,那么,有独立服务器的同学可以采用执行SQL语句的办法进行升级。
先备份 Ucenter 所在的数据库,然后一步一步执行以下语句,注意 Ucenter 的数据库前缀,如果不一样的话需要改改前缀:
建表语句:
- DROP TABLE IF EXISTS pre_ucenter_pm_members;
- CREATE TABLE pre_ucenter_pm_members (
- plid mediumint(8) unsigned NOT NULL default '0',
- uid mediumint(8) unsigned NOT NULL default '0',
- isnew tinyint(1) unsigned NOT NULL default '0',
- pmnum int(10) unsigned NOT NULL default '0',
- lastupdate int(10) unsigned NOT NULL default '0',
- lastdateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (plid,uid),
- KEY isnew (isnew),
- KEY lastdateline (uid,lastdateline),
- KEY lastupdate (uid,lastupdate)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_lists;
- CREATE TABLE pre_ucenter_pm_lists (
- plid mediumint(8) unsigned NOT NULL auto_increment,
- authorid mediumint(8) unsigned NOT NULL default '0',
- pmtype tinyint(1) unsigned NOT NULL default '0',
- subject varchar(80) NOT NULL,
- members smallint(5) unsigned NOT NULL default '0',
- min_max varchar(17) NOT NULL,
- dateline int(10) unsigned NOT NULL default '0',
- lastmessage text NOT NULL,
- PRIMARY KEY (plid),
- KEY pmtype (pmtype),
- KEY min_max (min_max),
- KEY authorid (authorid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_indexes;
- CREATE TABLE pre_ucenter_pm_indexes (
- pmid mediumint(8) unsigned NOT NULL auto_increment,
- plid mediumint(8) unsigned NOT NULL default '0',
- pmidold int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid),
- KEY pmidold (pmidold)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_0;
- CREATE TABLE pre_ucenter_pm_messages_0 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_1;
- CREATE TABLE pre_ucenter_pm_messages_1 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_2;
- CREATE TABLE pre_ucenter_pm_messages_2 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_3;
- CREATE TABLE pre_ucenter_pm_messages_3 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_4;
- CREATE TABLE pre_ucenter_pm_messages_4 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_5;
- CREATE TABLE pre_ucenter_pm_messages_5 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_6;
- CREATE TABLE pre_ucenter_pm_messages_6 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_7;
- CREATE TABLE pre_ucenter_pm_messages_7 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_8;
- CREATE TABLE pre_ucenter_pm_messages_8 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;
- DROP TABLE IF EXISTS pre_ucenter_pm_messages_9;
- CREATE TABLE pre_ucenter_pm_messages_9 (
- pmid mediumint(8) unsigned NOT NULL default '0',
- plid mediumint(8) unsigned NOT NULL default '0',
- authorid mediumint(8) unsigned NOT NULL default '0',
- message text NOT NULL,
- delstatus tinyint(1) unsigned NOT NULL default '0',
- dateline int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (pmid),
- KEY plid (plid,delstatus,dateline),
- KEY dateline (plid,dateline)
- ) TYPE=MyISAM;