Index: /branches/version-2_5-dev/html/install/index.php
===================================================================
--- /branches/version-2_5-dev/html/install/index.php	(revision 18786)
+++ /branches/version-2_5-dev/html/install/index.php	(revision 18787)
@@ -124,23 +124,4 @@
     $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
 
-    /*
-        lfAddTableは、バージョンアップ等で追加テーブルが発生した場合に実行する。
-        （ＤＢ構成の下位互換のためスキップ時も強制）
-    */
-    // テーブルが存在しない場合に追加される。
-    $objPage->arrErr = lfAddTable("dtb_session", $dsn);         // セッション管理テーブル
-    $objPage->arrErr = lfAddTable("dtb_module", $dsn);          // モジュール管理テーブル
-    $objPage->arrErr = lfAddTable("dtb_mobile_kara_mail", $dsn);    // 空メール管理テーブル
-    $objPage->arrErr = lfAddTable("dtb_mobile_ext_session_id", $dsn);   // セッションID管理テーブル
-    $objPage->arrErr = lfAddTable("dtb_site_control", $dsn);    // サイト情報管理テーブル
-    $objPage->arrErr = lfAddTable("dtb_trackback", $dsn);   // トラックバック管理テーブル
-
-
-    // カラムを追加
-    lfAddColumn($dsn);
-
-    // データを追加
-    lfAddData($dsn);
-
     if(count($objPage->arrErr) == 0) {
         // スキップする場合には次画面へ遷移
@@ -221,12 +202,4 @@
     }
     $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
-
-    // 追加テーブルがあれば削除する。
-    lfDropTable("dtb_module", $dsn);
-    lfDropTable("dtb_session", $dsn);
-    lfDropTable("dtb_mobile_ext_session_id", $dsn);
-    lfDropTable("dtb_mobile_kara_mail", $dsn);
-    lfDropTable("dtb_site_control", $dsn);
-    lfDropTable("dtb_trackback", $dsn);
 
     if ($arrRet['db_type'] == 'pgsql'){
@@ -837,25 +810,4 @@
 }
 
-// テーブルの追加（既にテーブルが存在する場合は作成しない）
-function lfAddTable($table_name, $dsn) {
-    global $objPage;
-    global $objDb;
-    $arrErr = array();
-    if(!$objDb->sfTabaleExists($table_name, $dsn)) {
-        list($db_type) = split(":", $dsn);
-        $sql_path = "./sql/add/". $table_name . "_" .$db_type .".sql";
-        $arrErr = lfExecuteSQL($sql_path, $dsn);
-        if(count($arrErr) == 0) {
-            $objPage->tpl_message.="○：追加テーブル($table_name)の作成に成功しました。<br>";
-        } else {
-            $objPage->tpl_message.="×：追加テーブル($table_name)の作成に失敗しました。<br>";
-        }
-    } else {
-        $objPage->tpl_message.="○：追加テーブル($table_name)が確認されました。<br>";
-    }
-
-    return $arrErr;
-}
-
 // テーブルの削除（既にテーブルが存在する場合のみ削除する）
 function lfDropTable($table_name, $dsn) {
@@ -878,114 +830,4 @@
     }
     return $arrErr;
-}
-
-// カラムの追加（既にカラムが存在する場合は作成しない）
-function lfAddColumn($dsn) {
-    global $objDBParam;
-    global $objDb;
-
-    // 受注テーブル
-    $objDb->sfColumnExists("dtb_order", "memo01", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo02", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo03", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo04", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo05", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo06", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo07", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo08", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo09", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order", "memo10", "text", $dsn, true);
-
-    // 受注一時テーブル
-    $objDb->sfColumnExists("dtb_order_temp", "order_id", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo01", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo02", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo03", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo04", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo05", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo06", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo07", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo08", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo09", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_order_temp", "memo10", "text", $dsn, true);
-
-    // 支払情報テーブル
-    $objDb->sfColumnExists("dtb_payment", "charge_flg", "int2 default 1", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "rule_min", "numeric", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "upper_rule_max", "numeric", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "module_id", "int4", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "module_path", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo01", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo02", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo03", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo04", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo05", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo06", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo07", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo08", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo09", "text", $dsn, true);
-    $objDb->sfColumnExists("dtb_payment", "memo10", "text", $dsn, true);
-
-    // 顧客
-    $objDb->sfColumnExists("dtb_customer", "mailmaga_flg", "int2", $dsn, true);
-
-    // インデックスの確認
-    if (!$objDb->sfColumnExists("dtb_customer", "mobile_phone_id", "text", $dsn, true)) {
-        // インデックスの追加
-        $objDb->sfIndexExists("dtb_customer", "mobile_phone_id", "dtb_customer_mobile_phone_id_key", 64, $dsn, true);
-    }
-
-// データの追加（既にデータが存在する場合は作成しない）
-function lfAddData($dsn) {
-    global $objDb;
-    // CSVテーブル
-    if($objDb->sfTabaleExists('dtb_csv', $dsn)) {
-        lfInsertCSVData(1,'category_id','カテゴリID',53,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_id','注文番号',1,'now()','now()', $dsn);
-        lfInsertCSVData(4,'customer_id','顧客ID',3,'now()','now()', $dsn);
-        lfInsertCSVData(4,'message','要望等',4,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_name01','顧客名1',5,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_name02','顧客名2',6,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_kana01','顧客名カナ1',7,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_kana02','顧客名カナ2',8,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_email','メールアドレス',9,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_tel01','電話番号1',10,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_tel02','電話番号2',11,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_tel03','電話番号3',12,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_fax01','FAX1',13,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_fax02','FAX2',14,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_fax03','FAX3',15,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_zip01','郵便番号1',16,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_zip02','郵便番号2',17,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_pref','都道府県',18,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_addr01','住所1',19,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_addr02','住所2',20,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_sex','性別',21,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_birth','生年月日',22,'now()','now()', $dsn);
-        lfInsertCSVData(4,'order_job','職種',23,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_name01','お届け先名前',24,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_name02','お届け先名前',25,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_kana01','お届け先カナ',26,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_kana02','お届け先カナ',27,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_tel01','電話番号1',28,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_tel02','電話番号2',29,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_tel03','電話番号3',30,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_fax01','FAX1',31,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_fax02','FAX2',32,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_fax03','FAX3',33,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_zip01','郵便番号1',34,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_zip02','郵便番号2',35,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_pref','都道府県',36,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_addr01','住所1',37,'now()','now()', $dsn);
-        lfInsertCSVData(4,'deliv_addr02','住所2',38,'now()','now()', $dsn);
-        lfInsertCSVData(4,'payment_total','お支払い合計',39,'now()','now()', $dsn);
-    }
-}
-
-// CSVテーブルへのデータの追加
-function lfInsertCSVData($csv_id,$col,$disp_name,$rank,$create_date,$update_date, $dsn) {
-    global $objDb;
-    $sql = "insert into dtb_csv(csv_id,col,disp_name,rank,create_date,update_date) values($csv_id,'$col','$disp_name',$rank,$create_date,$update_date);";
-    $objDb->sfDataExists("dtb_csv", "csv_id = ? AND col = ?", array($csv_id, $col), $dsn, $sql, true);
 }
 
Index: /branches/version-2_5-dev/html/install/sql/drop_view.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/drop_view.sql	(revision 18777)
+++ /branches/version-2_5-dev/html/install/sql/drop_view.sql	(revision 18787)
Index: /branches/version-2_5-dev/html/install/sql/column_comment.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/column_comment.sql	(revision 18786)
+++ /branches/version-2_5-dev/html/install/sql/column_comment.sql	(revision 18787)
Index: /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 18786)
+++ /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 18787)
@@ -562,6 +562,4 @@
     PRIMARY KEY (customer_id)
 ) TYPE=InnoDB;
-
-CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
 
 CREATE TABLE dtb_order (
@@ -1172,2 +1170,77 @@
     PRIMARY KEY (id)
 ) TYPE=InnoDB;
+
+CREATE TABLE dtb_mobile_ext_session_id (
+    session_id text NOT NULL,
+    param_key text,
+    param_value text,
+    url text,
+    create_date timestamp NOT NULL DEFAULT now()
+);
+
+CREATE TABLE dtb_mobile_kara_mail (
+    kara_mail_id serial PRIMARY KEY,
+    session_id text NOT NULL,
+    token text NOT NULL,
+    next_url text NOT NULL,
+    create_date timestamp NOT NULL DEFAULT now(),
+    email text,
+    receive_date timestamp
+);
+
+CREATE TABLE dtb_module (
+    module_id int NOT NULL UNIQUE,
+    module_code text NOT NULL,
+    module_name text NOT NULL,
+    sub_data text,
+    auto_update_flg smallint NOT NULL DEFAULT 0,
+    del_flg smallint NOT NULL DEFAULT 0,
+    create_date datetime NOT NULL ,
+    update_date datetime NOT NULL
+) TYPE=InnoDB;
+
+CREATE TABLE dtb_session (
+    sess_id varchar(50) NOT NULL,
+    sess_data text,
+    create_date datetime NOT NULL,
+    update_date datetime NOT NULL,
+    PRIMARY KEY (sess_id)
+) TYPE=InnoDB;
+
+CREATE TABLE dtb_site_control (
+    control_id int auto_increment NOT NULL,
+    control_title varchar(255) ,
+    control_text text ,
+    control_flg int NOT NULL DEFAULT 2,
+    del_flg int NOT NULL DEFAULT 0,
+    memo text ,
+    create_date datetime NOT NULL,
+    update_date datetime NOT NULL,
+    PRIMARY KEY  (control_id)
+) TYPE=InnoDB;
+
+CREATE TABLE dtb_trackback (
+    trackback_id int auto_increment NOT NULL,
+    product_id int NOT NULL,
+    blog_name varchar(255) NOT NULL DEFAULT '',
+    title varchar(255) NOT NULL DEFAULT '',
+    excerpt text NOT NULL ,
+    url text NOT NULL ,
+    status int NOT NULL DEFAULT 2,
+    del_flg int NOT NULL DEFAULT 0,
+    create_date datetime NOT NULL,
+    update_date datetime NOT NULL,
+    PRIMARY KEY (trackback_id)
+) TYPE=InnoDB;
+
+CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
+CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
+CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
+CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
+CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key(64));
+CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value(64));
+CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url(64));
+CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
+CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token(64));
+CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date);
+CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date);
Index: /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	(revision 18786)
+++ /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	(revision 18787)
@@ -563,6 +563,4 @@
     PRIMARY KEY (customer_id)
 );
-
-CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id);
 
 CREATE TABLE dtb_order (
@@ -1171,2 +1169,76 @@
 );
 
+CREATE TABLE dtb_mobile_ext_session_id (
+    session_id text NOT NULL,
+    param_key text,
+    param_value text,
+    url text,
+    create_date timestamp NOT NULL DEFAULT now()
+);
+
+CREATE TABLE dtb_mobile_kara_mail (
+    kara_mail_id serial PRIMARY KEY,
+    session_id text NOT NULL,
+    token text NOT NULL,
+    next_url text NOT NULL,
+    create_date timestamp NOT NULL DEFAULT now(),
+    email text,
+    receive_date timestamp
+);
+
+CREATE TABLE dtb_session (
+    sess_id text NOT NULL,
+    sess_data text,
+    create_date timestamp NOT NULL,
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (sess_id)
+);
+
+CREATE TABLE dtb_module (
+    module_id int NOT NULL UNIQUE,
+    module_code text NOT NULL,
+    module_name text NOT NULL,
+    sub_data text,
+    auto_update_flg int2 NOT NULL DEFAULT 0,
+    del_flg int2 NOT NULL DEFAULT 0,
+    create_date timestamp NOT NULL DEFAULT NOW(),
+    update_date timestamp NOT NULL
+);
+
+CREATE TABLE dtb_site_control (
+    control_id serial primary key NOT NULL,
+    control_title text ,
+    control_text text ,
+    control_flg int2 NOT NULL DEFAULT 2,
+    del_flg int2 NOT NULL DEFAULT 0,
+    memo text ,
+    create_date timestamp NOT NULL DEFAULT now(),
+    update_date timestamp NOT NULL DEFAULT now()
+);
+
+CREATE TABLE dtb_trackback (
+    trackback_id serial primary key NOT NULL,
+    product_id int NOT NULL,
+    blog_name varchar(255) NOT NULL DEFAULT '',
+    title varchar(255) NOT NULL DEFAULT '',
+    excerpt text NOT NULL DEFAULT '',
+    url text NOT NULL DEFAULT '',
+    status int2 NOT NULL DEFAULT 2,
+    del_flg int2 NOT NULL DEFAULT 0,
+    create_date timestamp NOT NULL,
+    update_date timestamp NOT NULL
+);
+
+CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id);
+CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
+CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
+CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
+
+CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key);
+CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value);
+CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url);
+CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
+
+CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token);
+CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date);
+CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date);
Index: /branches/version-2_5-dev/html/install/sql/drop_table.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/drop_table.sql	(revision 18786)
+++ /branches/version-2_5-dev/html/install/sql/drop_table.sql	(revision 18787)
@@ -88,3 +88,9 @@
 DROP TABLE dtb_customer_favorite_products;
 DROP TABLE mtb_down;
+DROP TABLE dtb_module;
+DROP TABLE dtb_session;
+DROP TABLE dtb_mobile_ext_session_id;
+DROP TABLE dtb_mobile_kara_mail;
+DROP TABLE dtb_site_control;
+DROP TABLE dtb_trackback;
 
Index: /branches/version-2_5-dev/html/install/sql/insert_data.sql
===================================================================
--- /branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 18786)
+++ /branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 18787)
@@ -1,6 +1,2 @@
-CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
-CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
-CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
-
 INSERT INTO dtb_member (name, login_id, password, creator_id, authority, work, del_flg, create_date, update_date)
 VALUES ('dummy','dummy',' ',0,0,1,1, now(), now());
@@ -181,5 +177,4 @@
 insert into dtb_csv(csv_id,col,disp_name,rank,create_date,update_date)values(3,'deliv_date','お届け指定日',54,now(),now());
 INSERT INTO dtb_csv(csv_id,col,disp_name,rank,create_date,update_date) VALUES (4,'order_id','注文番号',1,now(),now());
-INSERT INTO dtb_csv(csv_id,col,disp_name,rank,create_date,update_date) VALUES (4,'campaign_id','キャンペーンID',2,now(),now());
 INSERT INTO dtb_csv(csv_id,col,disp_name,rank,create_date,update_date) VALUES (4,'customer_id','顧客ID',3,now(),now());
 INSERT INTO dtb_csv(csv_id,col,disp_name,rank,create_date,update_date) VALUES (4,'message','要望等',4,now(),now());
@@ -1103,2 +1098,4 @@
 
 INSERT INTO dtb_module (module_id,module_code,module_name,update_date,create_date) VALUES (0,0,'patch',now(),now());
+
+INSERT INTO dtb_site_control (control_title, control_text) VALUES('トラックバック機能', 'トラックバック機能を使用するかどうかを決定します。');
