<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *  携帯管理モジュールアップデートクラス
 *
 * @package     NetCommons
 * @author      Noriko Arai,Ryuji Masukawa
 * @copyright   2006-2007 NetCommons Project
 * @license     http://www.netcommons.org/license.txt  NetCommons License
 * @project     NetCommons Project, supported by National Institute of Informatics
 * @access      public
 */
class Mobile_Update extends Action
{	
	//使用コンポーネントを受け取るため
	var $db = null;
	
    /**
     * execute実行
     *
     * @access  public
     */
	function execute()
	{
		$adodb = $this->db->getAdoDbObject();
		$metaTables = $adodb->MetaTables();
		if (!in_array($this->db->getPrefix()."mobile_menu_detail", $metaTables)) {
			$sql = "CREATE TABLE `".$this->db->getPrefix()."mobile_menu_detail` (".
					"`block_id`            int(11) NOT NULL,".
					"`page_id`             int(11) NOT NULL,".
					"`visibility_flag`     tinyint(1) NOT NULL default 1,".
					"`room_id`             int(11) NOT NULL default 0,".
					"`insert_time`         varchar(14) NOT NULL default '',".
					"`insert_site_id`      varchar(40) NOT NULL default '',".
					"`insert_user_id`      varchar(40) NOT NULL default '',".
					"`insert_user_name`    varchar(255) NOT NULL,".
					"`update_time`         varchar(14) NOT NULL default '',".
					"`update_site_id`      varchar(40) NOT NULL default '',".
					"`update_user_id`      varchar(40) NOT NULL default '',".
					"`update_user_name`    varchar(255) NOT NULL,".
					"PRIMARY KEY  (`block_id`,`page_id`)".
				") TYPE=MyISAM;";
			$result = $this->db->execute($sql);
			if ($result === false) {
				return false;
			}
		}
		return true;
	}
}
?>
