-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathUpdate.class.php
More file actions
37 lines (36 loc) · 1.1 KB
/
Update.class.php
File metadata and controls
37 lines (36 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* モジュールアップデートクラス
*
* @package NetCommons.components
* @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 Iframe_Update extends Action
{
//使用コンポーネントを受け取るため
var $db = null;
function execute()
{
// iframeにindexを追加
$sql = "SHOW INDEX FROM `".$this->db->getPrefix()."iframe` ;";
$results = $this->db->execute($sql);
if($results === false) return false;
$alter_table_room_id_flag = true;
foreach($results as $result) {
if(isset($result['Key_name']) && $result['Key_name'] == "room_id") {
$alter_table_room_id_flag = false;
}
}
if($alter_table_room_id_flag) {
$sql = "ALTER TABLE `".$this->db->getPrefix()."iframe` ADD INDEX ( `room_id` ) ;";
$result = $this->db->execute($sql);
if($result === false) return false;
}
return true;
}
}
?>