数据表的变动:
1、不再每个模型使用单独的评论和评论排序表,lecms是所有的内容模型共用评论和评论排序表(毕竟评论功能用的不多,没必要再每个模型使用单独的)
# 内容评论排序表 用来减小主表索引 (有评论时才写入)DROP TABLE IF EXISTS pre_cms_comment_sort;CREATE TABLE pre_cms_comment_sort ( mid tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '模型ID', id int(10) unsigned NOT NULL DEFAULT '0' COMMENT '内容ID', cid int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID', comments int(10) unsigned NOT NULL DEFAULT '0' COMMENT '评论数', lastdate int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后回复时间', UNIQUE KEY mid_id (mid,id), KEY cid_comments (cid,comments), KEY comments (comments), KEY cid_lastdate (cid,lastdate), KEY lastdate (lastdate)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;# 内容评论表 该功能用的不多 所有的模型内容评论都写入此表DROP TABLE IF EXISTS pre_cms_comment;CREATE TABLE pre_cms_comment ( commentid int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论ID', mid tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '模型ID', id int(10) unsigned NOT NULL DEFAULT '0' COMMENT '内容ID', uid int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', author varchar(20) NOT NULL DEFAULT '' COMMENT '作者', content varchar(255) NOT NULL DEFAULT '' COMMENT '评论内容', ip int(10) NOT NULL DEFAULT '0' COMMENT 'IP', dateline int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发表时间', reply_commentid int(10) unsigned NOT NULL DEFAULT '0' COMMENT '回复某评论ID', PRIMARY KEY (commentid), KEY mid_id (mid,id), KEY ip (ip,commentid)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
2、内容模型主表,比如 pre_cms_article,删掉 color 字段,增加 jumpurl 字段,另外有几个字段长度有变动。
ALTER TABLE pre_cms_article DROP `color`;ALTER TABLE pre_cms_article ADD jumpurl varchar(255) NOT NULL DEFAULT '' COMMENT '跳转URL';ALTER TABLE pre_cms_article CHANGE `seo_title` `seo_title` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_cms_article CHANGE `seo_keywords` `seo_keywords` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_cms_article CHANGE `seo_description` `seo_description` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_cms_article CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0';
3、内容模型附件表,比如 pre_cms_article_attach,增加了 积分 金币 字段,cid字段长度变动。
ALTER TABLE pre_cms_article_attach ADD credits int(10) unsigned NOT NULL DEFAULT '0' COMMENT '积分';ALTER TABLE pre_cms_article_attach ADD golds int(10) unsigned NOT NULL DEFAULT '0' COMMENT '金币';ALTER TABLE pre_cms_article_attach CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0';
4、内容模型标签表,比如 pre_cms_article_tag,增加了 pic SEO信息字段,name、content字段变动。
ALTER TABLE pre_cms_article_tag CHANGE `name` `name` CHAR(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_cms_article_tag CHANGE `content` `content` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_cms_article_tag ADD pic varchar(255) NOT NULL DEFAULT '' COMMENT '标签缩略图';ALTER TABLE pre_cms_article_tag ADD seo_title varchar(100) NOT NULL DEFAULT '' COMMENT 'SEO标题';ALTER TABLE pre_cms_article_tag ADD seo_keywords varchar(200) NOT NULL DEFAULT '' COMMENT 'SEO关键词';ALTER TABLE pre_cms_article_tag ADD seo_description varchar(255) NOT NULL DEFAULT '' COMMENT 'SEO描述';
5、内容模型浏览量表,比如 pre_cms_article_views,cid字段变动。
ALTER TABLE pre_cms_article_views CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0';
6、单页表、伪静态别名表 cid字段变动
ALTER TABLE pre_cms_page CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0';ALTER TABLE pre_only_alias CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0';
7、模型表增加字段(模型内容缩略图宽度、高度、以及菜单图标)
ALTER TABLE pre_models ADD width smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '缩略图宽度';ALTER TABLE pre_models ADD height smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '缩略图高度';ALTER TABLE pre_models ADD icon varchar(30) NOT NULL DEFAULT 'fa fa-bars' COMMENT '后台菜单图标';
8、增加了模型字段表(自定义模型字段使用)
CREATE TABLE IF NOT EXISTS pre_models_field ( id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', mid tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '模型ID', field char(20) NOT NULL DEFAULT '' COMMENT '字段名', name varchar(30) NOT NULL DEFAULT '' COMMENT '显示名', inputtype varchar(20) NOT NULL DEFAULT '' COMMENT '类型', tips varchar(255) NOT NULL DEFAULT '' COMMENT '提示', setting mediumtext NOT NULL COMMENT '设置', isbase tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否主表(0附表,1主表)', required tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否必填', orderby int(10) NOT NULL DEFAULT '0' COMMENT '排序', PRIMARY KEY (id), KEY (mid), UNIQUE KEY mid_field (mid,field)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
9、分类表增加了 pic 和 投稿 字段,以及部分字段变动
ALTER TABLE pre_category ADD contribute tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '允许投稿';ALTER TABLE pre_category ADD pic varchar(255) NOT NULL DEFAULT '' COMMENT '分类图';ALTER TABLE pre_category CHANGE `cid` `cid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;ALTER TABLE pre_category CHANGE `orderby` `orderby` INT(10) UNSIGNED NOT NULL DEFAULT '0';ALTER TABLE pre_category CHANGE `seo_title` `seo_title` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_category CHANGE `seo_keywords` `seo_keywords` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_category CHANGE `seo_description` `seo_description` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
10、用户组表增加两条用户组信息
INSERT INTO pre_user_group (`groupid`, `groupname`, `system`, `purviews`) VALUES (10, '永久VIP', 1, ''),(12, 'VIP用户', 1, '');
11、用户表增加和删除字段、以及部分字段变动
ALTER TABLE pre_user ADD author varchar(20) NOT NULL DEFAULT '' COMMENT '昵称';ALTER TABLE pre_user ADD credits int(10) unsigned NOT NULL DEFAULT '0' COMMENT '积分';ALTER TABLE pre_user ADD golds int(10) unsigned NOT NULL DEFAULT '0' COMMENT '金币';ALTER TABLE pre_user ADD mobile varchar(20) NOT NULL DEFAULT '' COMMENT '手机号';ALTER TABLE pre_user ADD avatar varchar(255) NOT NULL DEFAULT '' COMMENT '头像';ALTER TABLE pre_user DROP comments;ALTER TABLE pre_user CHANGE `homepage` `homepage` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';ALTER TABLE pre_user CHANGE `intro` `intro` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
12、kv表和runtime表字段变动
ALTER TABLE pre_kv CHANGE `v` `v` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;ALTER TABLE pre_runtime CHANGE `v` `v` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
你可以直接在 twcms后台安装插件转换哦: 传送门
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。 各类知识收集 拥有多年CMS企业建站经验,对 iCMS, Fastadmin, ClassCMS, LeCMS, PbootCMS, PHPCMS, 易优CMS, YzmCMS, 讯睿CMS, 极致CMS, Wordpress, HkCMS, YznCMS, WellCMS, ThinkCMF, 等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。