<?php

		require_once('constant.php');
		require_once('ls_syscode.php');
		
		if(!isset($lsVer))  //设置版本号
		{
			writeconstant("lsVer", 1.1 ,"str","insert");	
		}

		if($lsVer<1.71)		//更新版本
		{
			updatedb();
			writeconstant("lsVer", 1.171 ,"int");	
		}

/*
更新数据库

*/
function updatedb()
{
		require_once('conn.php');
		$openck=new cktb();
		
		//ls_revolvingpics
		$tableName="ls_revolvingpics";
		$addTBSQL="CREATE TABLE `".$tableName."` (
		`ID` int( 4 ) NOT NULL AUTO_INCREMENT ,
		`Pic` varchar( 120 ) DEFAULT NULL ,
		`Text` text,
		`Num` int( 4 ) DEFAULT NULL ,
		`enable` int( 1 ) NOT NULL ,
		PRIMARY KEY ( `ID` ) 
		) ENGINE = MYISAM DEFAULT CHARSET = utf8 ROW_FORMAT = DYNAMIC ;";
		$openck->checktable($tableName,$addTBSQL);


		$qureyTBSQL="ALTER TABLE `ls_revolvingpics` COMMENT = '主页流动图 片 '";
		$openck->qureytable($qureyTBSQL);


		//automationGif
		$tableName="ls_products";
		$fieldName="automationGif";
		$addFDSQL="ALTER TABLE `".$tableName."` ADD `".$fieldName."` TINYINT( 1 ) NULL COMMENT '动画GIF标志，1代表动画GIF' AFTER `productID`";
 		$openck->checkfield($tableName,$fieldName,$addFDSQL);
	//add 
}




?>