'update 3.5 to 4.0
CREATE TABLE Menu (id int IDENTITY (1,1) NOT null,ParentNodeId integer,[Text] varchar(100),ImageUrl varchar(100),Url varchar(255),Target varchar(10),Show varchar(1),OrderID integer,Sys varchar(1),Depth integer,Expand varchar(1),m varchar(1))
Select count(id) as tcount From Menu
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('存储系统','pics/earth.gif','right.aspx','wdcontent','1',1,'0',0)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth,m) values ('文件管理','pics/files.gif','ContentPane.aspx','wdcontent','1',2,'0',0,'1')
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('我的共享','pics/filesys.gif','','wdcontent','1',3,'0',0)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (3,'共享目录','pics/filesys.gif','sharesee.aspx?type=1','wdcontent','1',4,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (3,'共享文件','pics/filesys.gif','sharesee.aspx?type=2','wdcontent','1',5,'0',1)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('我的好友','pics/users.gif','','wdcontent','1',6,'0',0)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (6,'我加的好友','pics/users.gif','myfriend.aspx','wdcontent','1',7,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (6,'加我的好友','pics/users.gif','myfriendadd.aspx','wdcontent','1',8,'0',1)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('下载统计','pics/tj.gif','downcount.aspx','wdcontent','1',9,'0',0)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('公共共享','pics/filesys.gif','','wdcontent','1',10,'0',0)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (10,'共享目录','pics/folder2.gif','allfolder.aspx','wdcontent','1',11,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (10,'共享文件','pics/folder2.gif','allshare.aspx','wdcontent','1',12,'0',1)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('查找用户','pics/users.gif','search_user.aspx','wdcontent','1',13,'0',0)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('个性空间','pics/syssetup.gif','','wdcontent','1',14,'0',0)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (14,'选项设置','pics/syssetup.gif','mysetup.aspx','wdcontent','1',15,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (14,'风格选择','pics/syssetup.gif','mystyle.aspx','wdcontent','1',16,'0',1)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('留言管理','pics/page.gif','user_ly.aspx','wdcontent','1',17,'0',0)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('短信管理','pics/page.gif','','wdcontent','1',18,'0',0)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (18,'收件箱','pics/page.gif','user_sms.aspx?type=1','wdcontent','1',19,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (18,'发件箱','pics/page.gif','user_sms.aspx?type=2','wdcontent','1',20,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (18,'已发送','pics/page.gif','user_sms.aspx?type=3','wdcontent','1',21,'0',1)
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (18,'废件箱','pics/page.gif','user_sms.aspx?type=4','wdcontent','1',22,'0',1)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('修改资料','pics/tj.gif','regedit.aspx','wdcontent','1',23,'0',0)
*insert into Menu ([Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values ('退出登录','pics/exits.gif','exit.aspx','_top','1',24,'0',0)
alter table admin add flag text,isadmin varchar(1),allowip text
update admin set flag='0',isadmin='1' where flag is null
CREATE TABLE Admin_Log (id int IDENTITY (1,1) NOT null,ActionPostion varchar(50),[Action] varchar(50),ActionTime datetime,IP varchar(50),ActionUser varchar(50))
alter table config add adv6 text,noshow5 varchar(1),softadv1 text,softadv2 text,softadv3 text,noshow6 varchar(1),noshow7 varchar(1),noshow8 varchar(1),logo varchar(200),temppath varchar(255),jf_use varchar(1),jf_reg integer,jf_tj integer,jf1 integer,jf2 integer,alipaypartner varchar(50),alipayemail varchar(50),alipaykey varchar(50),usepay varchar(1),banksubmit varchar(1),allowip text,passtype varchar(1),outteam varchar(1),softheight varchar(3),softtime varchar(3),ValidateCode1 varchar(1),ValidateCode2 varchar(1)
CREATE TABLE gg (id int IDENTITY (1,1) NOT null,[level] text,team text,guest varchar(1),title varchar(255),content text,[datetime] datetime,adduser varchar(50))
alter table [level] add tools varchar(1),hide varchar(1)
update config set temppath='temp',softheight=70,softtime=10 where temppath is null
alter table reg add jf integer,tjuser varchar(50),style integer,cxnum integer,[link] text
CREATE TABLE style (id int IDENTITY (1,1) NOT null,pic varchar(100),title varchar(100),path varchar(100),show varchar(1),mr varchar(1))
update reg set jf=0 where jf is null
update config set jf_reg=0,jf_tj=5,jf1=20,jf2=5 where jf is null
update config set usepay='1',jf_use='0',banksubmit='0',passtype='0',logo='pics/bz.gif' where usepay is null
update [level] set tools='1 where tools is null
Select count(id) as tcount From style
*insert into style (pic,title,path,show,mr) values ('style/default/style.gif','默认样式','style/default/style.css','1','1')
*insert into style (pic,title,path,show,mr) values ('style/blue/style.gif','蓝色天空','style/blue/style.css','1','')
*insert into style (pic,title,path,show,mr) values ('style/green/style.gif','青青河草','style/green/style.css','1','')
*insert into style (pic,title,path,show,mr) values ('style/red/style.gif','橘子红了','style/red/style.css','1','')
alter table allpath add UserTop varchar(1),UserGood varchar(1)
update reg set ulock='0' where ulock='锁定'
update reg set ulock='1' where ulock='解锁'

'update 4.0 to 4.1
alter table config add time1 varchar(5),time2 varchar(5),time3 varchar(5),time4 varchar(5),passmailt varchar(100),passmail text,expirymailt varchar(100),expirymail text,markmailt varchar(100),markmail text,regcount integer,regsuccmailt varchar(100),regsuccmail text,sendregsucc varchar(1),allowregip text
alter table downshow add DownSize integer,FromUrl varchar(255)
alter table reg add logincount integer
update config set time1='',time2='',time3='',time4='',passmailt='您的网盘找回密码',passmail='请点击以下链接以便重新设置您的密码：<br>&url',expirymailt='您的网盘空间即将到期',expirymail='您的网盘空间即将在&url到期，请您尽快进行充值操作，充值网址<br>&url',markmailt='您的网盘激活密码',markmail='请点击以下链接激活您的网盘密码：<br>&url',regcount=0,regsuccmailt='欢迎您注册网络硬盘',regsuccmail='以下是您的注册信息<p>&userinfo',sendregsucc='0' where time1 is null
update reg set logincount=0 where logincount is null

'update 4.2 to 4.3
alter table reg add usesoft varchar(1)
alter table config add lyconf varchar(1)
alter table ly add mark varchar(1)
update config set lyconf='0' where lyconf is null
CREATE TABLE transfer (id int IDENTITY (1,1) NOT null,T_name varchar(50),T_sm varchar(100),T_type varchar(1),T_count integer,T_len integer,T_order varchar(1),T_filter varchar(1),T_user text,T_kind text,T_level varchar(50),T_ext varchar(255),Skin_Head text,Skin_Main text,Skin_Footer text)

'update 4.3 to 4.4
alter table config add syskey varchar(20),allowrecord varchar(1)
alter table transfer add T_lytype varchar(1)
update config set allowrecord='1' where allowrecord is null

'update 4.4 to 4.5
alter table Friend add Team integer
alter table AllPath add FriendTeam varchar(100)
update allpath set friendteam=',0,' where share='1' and friendteam is null
update Friend set team=0 where team is null
CREATE TABLE FriendTeam (id int IDENTITY (1,1) NOT null,username varchar(50),friendteam varchar(50))
Select id From Menu where url='myfriendteam.aspx'
*insert into Menu (ParentNodeId,[Text],ImageUrl,Url,Target,Show,OrderID,Sys,Depth) values (6,'好友分组','pics/users.gif','myfriendteam.aspx','wdcontent','1',8,'0',1)

'update 4.6 to 5.0
alter table config add photozh varchar(1),photourl varchar(255),photocode varchar(50),billcode varchar(50),billmd5 varchar(50),lysec integer,trashday varchar(50),tenpaycode varchar(50),tenpaykey varchar(50),usepaylist varchar(20),jf_pay integer,mrupload varchar(1),mrpage varchar(1),zhtitle varchar(50),downpage varchar(50)
alter table allpath add editperson varchar(20),IsDel varchar(1),[mark] varchar(1),ShareDown text
CREATE TABLE template (id int IDENTITY (1,1) NOT null,[label] varchar(50),[note] varchar(255),para varchar(255),content text,type varchar(2))
CREATE TABLE PlugIn (id int IDENTITY (1,1) NOT null,PlugIn varchar(50),Page varchar(50),content text)
alter table reg add usetrash varchar(1),autorename varchar(1),overshare varchar(1)
alter table [level] add mark varchar(1),onlymedown varchar(1)
alter table shorturl add code varchar(255)
update config set trashday='3',mrupload='0',mrpage='0',lyconf='0' where trashday is null
update allpath set mark='1' where mark is null
update [level] set mark='1' where mark is null
update reg set overshare='1' where overshare is null
update allpath set IsDel='' where IsDel is null
Select count(id) as tcount From template
*insert into template ([label],[note],para,content,type) values ('filelist','文件列表','LastTime|Desc,0,0,20,30,,0,,0,,0','<tr bgcolor=#E8F0FF height=20><td width=25 align=center>{$ico}</td><td><a href={$down}>{$filename}</a>{$addico}  <font color=#999999>{$note}</font></td><td width=120 align=center>{$user}</td><td width=120>  <div lign=center>{$size}</div></td><td width=120><div align=center>{$time}</div></td></tr>','1')
*insert into template ([label],[note],para,content,type) values ('page','分页','currpage,page,10','总共记录数：{$recordcount}&nbsp;&nbsp;页码：{$pagelist}&nbsp;&nbsp;<a href={$firstpage}>第一页</a>&nbsp;&nbsp;<a href={$priorpage}>上一页</a>&nbsp;&nbsp;<a href={$nextpage}>下一页</a>&nbsp;&nbsp;<a href={$lastpage}>最末页</a>&nbsp;&nbsp;第&nbsp;{$currpage}&nbsp;页/共&nbsp;{$countpage}&nbsp;页','5')
*update style set pic='style/gray/style.gif',title='灰白空间',path='style/gray/style.css' where path='style/default/style.css'
*update style set mr=''
*update style set mr='1' where id=2
*update allpath set ShareDown=ShareSee where ShareDown is null
ALTER TABLE admin_log ALTER COLUMN [action] text

'update 5.0 to 5.1
alter table config add allowly varchar(1),whtml varchar(1),wext varchar(10),wurl varchar(50)
update config set allowly='1',whtml='1',wext='.aspx' where allowly is null

'update 5.1 to 5.2
alter table reg add mrorder varchar(50)
alter table config add mrorder varchar(50)
update config set mrorder='update desc' where mrorder is null or mrorder=''
update reg set overshare='1' where overshare is null

'update 5.2 to 5.3
alter table downshow add ip varchar(50)
alter table [level] add limit14 varchar(1),uploadrate integer
update [level] set uploadrate=0 where uploadrate is null
alter table reg add adv text
alter table config add mastdownpage varchar(1)
ALTER TABLE allpath ALTER COLUMN filesize bigint

'update 5.5 to 5.6
alter table reg add openid varchar(50)
alter table config add qqapp varchar(20),qqkey varchar(50),editsoft varchar(1)