--v6.1版本处理脚本执行情况，具体根据各个测试阶段发布的v6.1版本酌情执行。
--设置栏目默认开启时间显示
insert into bigclassdesign(menuId,cssname,isflag,imageFlag,isnew,imagenew,ishot,imagehot,istop,imagetop,ismore,imagemore,isdept,isclick,istime)
select  pkid,'',0,'./Images/artdesign/itemImage/system_flag.png' ,1,'./images/artdesign/newImage/system_new.gif',0,'./images/artdesign/hotImage/system_hot.gif',0,'./images/artdesign/topImage/system_top.gif',1,'更多&gt;&gt;',0,0,6
from menu where modeid=4 and pkid not in(select menuid from bigclassDesign)

--更新不开启使用栏目模板
update menu set artDesignTemplateId='0' where modeid='4' and artDesignTemplateId='1'

--更新显示时间
update bigClassDesign set isTime='8' where isTime='0'

--更新最新新闻不显示栏目名称
update menu set contributesorttype='1' where modeid='4' and contributesorttype='0' and
bigclassid in (
select b.pkid from bigclass b ,template t where b.templateid=t.pkid and t.pkid=28
)

--处理用户组权限表冗余数据
delete groupAssign where menuId not in (select pkId from menu)
go
--处理用户授权冗余数据
delete moduleAssign where menuId not in (select pkId from menu)
go
--处理抄送信息审核异常数据
update news set passed='1' where passed is null

----------------------------------------------------------------------
--v6.3版本升级处理脚本
----------------------------------------------------------------------
--需要清理原来列表标题中存放的html标签，检索出数据库中的href=”开头”结束的链接字符
update news set listtitle=left(right(listTitle,len(listTitle)-charindex('href="',listTitle)-5),charindex('"',right(listTitle,len(listTitle)-charindex('href="',listTitle)-5))-1) where charindex('href="',listTitle)>0
go

--取该栏目最新一条新闻的new.Width和height作为menu的默认值
update a set width=(select top 1 width from news d where d.bigclassId=a.bigclassid  order by updateTime desc),
height=(select top 1 height from news d where d.bigclassId=a.bigclassid  order by updateTime desc)
from menu a,bigclass b,template c
where a.bigclassid=b.pkid and b.templateId=c.pkid and c.typeId=2 and a.width is null and a.height is null

go


--批量处理栏目类型名称--v6.1版本更过一次。此处重复执行防止遗漏。
update template set [name]='网站搜索(无选择条件)' where pkid='17'
GO
update template set [name]='会员登录(横向)' where pkid='18'
GO
update template set [name]='网站搜索(无选择条件)' where pkid='17'
GO
update template set [name]='新闻点击排行' where pkid='7'
GO

--修改templateType表中数据--v6.1版本更过一次。此处重复执行防止遗漏。此处分类影响图文类栏目指定默认图片宽高。
--1.新闻类2.图文类3.链接类4.互动类5.工具类
update templatetype set [name]='news',type='新闻类' where pkid='1'
GO
UPDATE templateType SET [name] ='picVedio',type ='图文类' where pkId='2'
GO
UPDATE templateType SET [name] ='interact',type ='互动类'  where pkId='4'
GO
UPDATE templateType SET [name] ='tool' ,type = '功能类' where pkId='5' 
GO
update template set typeId='1' where pkid in (1,5,7,10,13,23,28,36)
GO
update template set typeId='2' where pkid in (6,12,24,25,26,27,43,71)
GO
update template set typeId='3' where pkid='37'
GO
update template set typeId='4' where pkid in (14,22,32,33,45,46,47,48,60,63,65)
GO
update template set typeId='5' where pkid in (9,11,15,16,17,18,19,30,58,65,66,67,69,72,73,74)
GO
update template set typeId='6' where pkid in (49,50,51,52,53,54,55,56,57,62,64,68,70)
GO

--浏览权限:批量更新【仅外网用户访问2】改为【无限制0】
update news set gate=0 where gate=2
go

------------------------------------------------------------
--处理留言本功能升级
------------------------------------------------------------
--初始化数据将留言回复审核设置为通过
update messageboard set reAudit='1'
go


--用户权限：批量追加留言本、留言问答栏目回复审核权限，默认通过
update moduleAssign set privilegeset= privilegeset+'|canAuditReply=1|defaultReplyPassed=1' 
where menuid in ( 
select pkid from menu where modeid=4 and bigclassid in (select pkid from bigclass where templateid in (32,63) )) 
and privilegeset not like '%canAuditReply%'
go

--用户组权限：批量追加留言本、留言问答栏目在回复审核权限，默认通过
update groupAssign set privilegeset= privilegeset+'|canAuditReply=1|defaultReplyPassed=1' 
where menuid in ( 
select pkid from menu where modeid=4 and bigclassid in (select pkid from bigclass where templateid in (32,63) )) 
and privilegeset not like '%canAuditReply%'
go


--删除网站调查栏目的冗余权限信息
delete from templatePrivilege where templateid='14' and privilegeid='8'
go
delete from templatePrivilege where templateid='14' and privilegeid='9'
go
