SET QUOTED_IDENTIFIER ON 
SET NOCOUNT ON


/* 此段代码更新布局新闻页默认选择为136模板，否则升级后由于数据缺省导致user平台添加新闻报错 */
update menu set newsTemplateId='136' where modeid='4' and newsTemplateId is null
GO
update template set [name]='文章列表' where pkid='1'
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表中数据
--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,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


--此脚本为数据库图片路径修正脚本，用于修正6.0.0版本升级后图片显示路径不正确的问题。
update news set imagename=('/images/uploadfiles/'+imagename) where imagename != ''
GO

--此脚本用于以上替换出错后用于撤销替换的脚本

--UPDATE news SET imagename=REPLACE(imagename,'/images/uploadfiles/','') where imagename != ''


SET NOCOUNT OFF
SET QUOTED_IDENTIFIER OFF 