Index: branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment_input.tpl
===================================================================
--- branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment_input.tpl	(revision 21539)
+++ branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment_input.tpl	(revision 21810)
@@ -63,5 +63,5 @@
                 <th>利用条件(円)</th>
                 <td>
-                    <!--{assign var=key_from value="rule"}-->
+                    <!--{assign var=key_from value="rule_max"}-->
                     <!--{assign var=key_to value="upper_rule"}-->
                     <span class="attention"><!--{$arrErr[$key_from]}--></span>
Index: branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment.tpl
===================================================================
--- branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment.tpl	(revision 21539)
+++ branches/version-2_12-dev/data/Smarty/templates/admin/basis/payment.tpl	(revision 21810)
@@ -61,5 +61,5 @@
             <!--{/if}-->
             <td class="center">
-                <!--{if $arrPaymentListFree[cnt].rule > 0}--><!--{$arrPaymentListFree[cnt].rule|number_format|h}--><!--{else}-->0<!--{/if}-->円
+                <!--{if $arrPaymentListFree[cnt].rule_max > 0}--><!--{$arrPaymentListFree[cnt].rule_max|number_format|h}--><!--{else}-->0<!--{/if}-->円
                 <!--{if $arrPaymentListFree[cnt].upper_rule > 0}-->～<!--{$arrPaymentListFree[cnt].upper_rule|number_format|h}-->円<!--{elseif $arrPaymentListFree[cnt].upper_rule == "0"}--><!--{else}-->～無制限<!--{/if}--></td>
             <td class="center"><!--{if $arrPaymentListFree[cnt].fix != 1}--><a href="?" onclick="fnChangeAction('./payment_input.php'); fnModeSubmit('pre_edit', 'payment_id', <!--{$arrPaymentListFree[cnt].payment_id}-->); return false;">編集</a><!--{else}-->-<!--{/if}--></td>
Index: branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php	(revision 21664)
+++ branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php	(revision 21810)
@@ -540,15 +540,15 @@
         $where = 'del_flg = 0 AND payment_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($arrPaymentIds)) . ')';
         $objQuery->setOrder('rank DESC');
-        $payments = $objQuery->select('payment_id, payment_method, rule, upper_rule, note, payment_image, charge', 'dtb_payment', $where, $arrPaymentIds);
+        $payments = $objQuery->select('payment_id, payment_method, rule_max, upper_rule, note, payment_image, charge', 'dtb_payment', $where, $arrPaymentIds);
         foreach ($payments as $data) {
             // 下限と上限が設定されている
-            if (strlen($data['rule']) != 0 && strlen($data['upper_rule']) != 0) {
-                if ($data['rule'] <= $total && $data['upper_rule'] >= $total) {
+            if (strlen($data['rule_max']) != 0 && strlen($data['upper_rule']) != 0) {
+                if ($data['rule_max'] <= $total && $data['upper_rule'] >= $total) {
                     $arrPayment[] = $data;
                 }
             }
             // 下限のみ設定されている
-            elseif (strlen($data['rule']) != 0) {
-                if ($data['rule'] <= $total) {
+            elseif (strlen($data['rule_max']) != 0) {
+                if ($data['rule_max'] <= $total) {
                     $arrPayment[] = $data;
                 }
Index: branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php	(revision 21810)
@@ -328,6 +328,6 @@
             // ポイント差し引き後の決済方法チェック
             $arrPayments = $objPurchase->getPaymentsByPaymentsId($arrForm['payment_id']);
-            if ($arrPayments['rule'] > $subtotal - $arrForm['use_point'] * POINT_VALUE) {
-                $objErr->arrErr['use_point'] = '※ 選択した支払方法では、ポイントは'.($subtotal - $arrPayments['rule']).'ポイントまでご利用いただけます。<br>';
+            if ($arrPayments['rule_max'] > $subtotal - $arrForm['use_point'] * POINT_VALUE) {
+                $objErr->arrErr['use_point'] = '※ 選択した支払方法では、ポイントは'.($subtotal - $arrPayments['rule_max']).'ポイントまでご利用いただけます。<br>';
             }
         }
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php	(revision 21810)
@@ -126,5 +126,5 @@
     function lfGetPaymentList() {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
-        $col = 'payment_id, payment_method, charge, rule, upper_rule, note, fix, charge_flg';
+        $col = 'payment_id, payment_method, charge, rule_max, upper_rule, note, fix, charge_flg';
         $where = 'del_flg = 0';
         $table = 'dtb_payment';
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php	(revision 21810)
@@ -131,5 +131,5 @@
                     $objFormParam->addParam('支払方法', 'payment_method', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
                     $objFormParam->addParam('手数料', 'charge', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
-                    $objFormParam->addParam('利用条件(～円以上)', 'rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+                    $objFormParam->addParam('利用条件(～円以上)', 'rule_max', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                     $objFormParam->addParam('利用条件(～円以下)', 'upper_rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                     $objFormParam->addParam('固定', 'fix');
@@ -176,5 +176,5 @@
                 $objFormParam->addParam('支払方法', 'payment_method', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('手数料', 'charge', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
-                $objFormParam->addParam('利用条件(～円以上)', 'rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+                $objFormParam->addParam('利用条件(～円以上)', 'rule_max', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('利用条件(～円以下)', 'upper_rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('固定', 'fix');
@@ -188,5 +188,5 @@
                 $objFormParam->addParam('支払方法', 'payment_method', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('手数料', 'charge', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
-                $objFormParam->addParam('利用条件(～円以上)', 'rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+                $objFormParam->addParam('利用条件(～円以上)', 'rule_max', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('利用条件(～円以下)', 'upper_rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('固定', 'fix');
@@ -202,5 +202,5 @@
                 $objFormParam->addParam('支払方法', 'payment_method', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('手数料', 'charge', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
-                $objFormParam->addParam('利用条件(～円以上)', 'rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+                $objFormParam->addParam('利用条件(～円以上)', 'rule_max', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('利用条件(～円以下)', 'upper_rule', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
                 $objFormParam->addParam('固定', 'fix');
@@ -265,5 +265,5 @@
 
         // 利用条件(下限)チェック
-        if ($arrRet['rule'] < $arrPaymentData['rule_min'] and $arrPaymentData['rule_min'] != '') {
+        if ($arrRet['rule_max'] < $arrPaymentData['rule_min'] and $arrPaymentData['rule_min'] != '') {
             $objErr->arrErr['rule'] = '利用条件(下限)は' . $arrPaymentData['rule_min'] .'円以上にしてください。<br>';
         }
@@ -275,5 +275,5 @@
 
         // 利用条件チェック
-        $objErr->doFunc(array('利用条件(～円以上)', '利用条件(～円以下)', 'rule', 'upper_rule'), array('GREATER_CHECK'));
+        $objErr->doFunc(array('利用条件(～円以上)', '利用条件(～円以下)', 'rule_max', 'upper_rule'), array('GREATER_CHECK'));
 
         return $objErr->arrErr;
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php	(revision 21810)
@@ -204,4 +204,5 @@
             $sqlval[$val] = $array[$val];
         }
+        $sqlval['id'] = 1;
         $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
         // INSERTの実行
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php	(revision 21810)
@@ -138,4 +138,5 @@
         // 入力データを渡す。
         $sqlval = $post;
+        $sqlval['id'] = 1;
         $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
         $objQuery =& SC_Query_Ex::getSingletonInstance();
Index: branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php	(revision 21743)
+++ branches/version-2_12-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php	(revision 21810)
@@ -243,4 +243,5 @@
             if ($cntCurrentLine >= $start) {
                 $sqlval = array();
+                $sqlval['zip_id'] = $cntInsert;
                 $sqlval['zipcode'] = $arrCSV[2];
                 $sqlval['state'] = $arrCSV[6];
Index: branches/version-2_12-dev/html/install/index.php
===================================================================
--- branches/version-2_12-dev/html/install/index.php	(revision 21756)
+++ branches/version-2_12-dev/html/install/index.php	(revision 21810)
@@ -519,4 +519,5 @@
     $arrDsn = getArrayDsn($objDBParam);
 
+    $sqlval['id'] = 1;
     $sqlval['shop_name'] = $objWebParam->getValue('shop_name');
     $sqlval['email01'] = $objWebParam->getValue('admin_mail');
Index: branches/version-2_12-dev/html/install/sql/insert_data.sql
===================================================================
--- branches/version-2_12-dev/html/install/sql/insert_data.sql	(revision 21798)
+++ branches/version-2_12-dev/html/install/sql/insert_data.sql	(revision 21810)
@@ -682,8 +682,8 @@
 INSERT INTO dtb_pagelayout (device_type_id, page_id, page_name, url, filename, header_chk, footer_chk, edit_flg, author, description, keyword, update_url, create_date, update_date) VALUES (1, 37, 'ご利用ガイド/運営会社紹介', 'guide/about.php', 'guide/about', 1, 1, 2, NULL, NULL, NULL, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
 
-INSERT INTO dtb_payment (payment_id, payment_method, charge, rule, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (1, '郵便振替', 0, NULL, 4, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-INSERT INTO dtb_payment (payment_id, payment_method, charge, rule, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (2, '現金書留', 0, NULL, 3, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-INSERT INTO dtb_payment (payment_id, payment_method, charge, rule, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (3, '銀行振込', 0, NULL, 2, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-INSERT INTO dtb_payment (payment_id, payment_method, charge, rule, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (4, '代金引換', 0, NULL, 1, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO dtb_payment (payment_id, payment_method, charge, rule_max, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (1, '郵便振替', 0, NULL, 4, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO dtb_payment (payment_id, payment_method, charge, rule_max, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (2, '現金書留', 0, NULL, 3, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO dtb_payment (payment_id, payment_method, charge, rule_max, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (3, '銀行振込', 0, NULL, 2, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO dtb_payment (payment_id, payment_method, charge, rule_max, rank, note, fix, status, del_flg, creator_id, create_date, update_date, payment_image, upper_rule, charge_flg, rule_min, upper_rule_max, module_id, module_path, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10) VALUES (4, '代金引換', 0, NULL, 1, NULL, 2, 1, 0, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
 INSERT INTO dtb_product_categories (product_id, category_id, rank) VALUES (1, 5, 1);
Index: branches/version-2_12-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- branches/version-2_12-dev/html/install/sql/create_table_mysql.sql	(revision 21795)
+++ branches/version-2_12-dev/html/install/sql/create_table_mysql.sql	(revision 21810)
@@ -12,5 +12,6 @@
 
 CREATE TABLE dtb_ownersstore_settings (
-    public_key text
+    public_key text,
+    PRIMARY KEY(public_key(64))
 );
 
@@ -41,8 +42,10 @@
 
 CREATE TABLE mtb_zip (
+    zip_id int,
     zipcode text,
     state text,
     city text,
-    town text
+    town text,
+    PRIMARY KEY (zip_id)
 );
 
@@ -66,4 +69,5 @@
 
 CREATE TABLE dtb_baseinfo (
+    id int,
     company_name text,
     company_kana text,
@@ -129,5 +133,6 @@
     longitude text,
     downloadable_days numeric DEFAULT 30,
-    downloadable_days_unlimited smallint
+    downloadable_days_unlimited smallint,
+    PRIMARY KEY (id)
 );
 
@@ -174,5 +179,5 @@
     payment_method text,
     charge numeric,
-    rule numeric,
+    rule_max numeric,
     rank int,
     note text,
@@ -387,5 +392,6 @@
     creator_id int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (recommend_product_id)
 );
 
@@ -628,5 +634,6 @@
     memo09 text,
     memo10 text,
-    session text
+    session text,
+    PRIMARY KEY (order_temp_id(64))
 );
 
@@ -1085,5 +1092,6 @@
     param_value text,
     url text,
-    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    PRIMARY KEY (session_id(255))
 );
 
@@ -1096,5 +1104,6 @@
     del_flg smallint NOT NULL DEFAULT 0,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (module_id)
 );
 
Index: branches/version-2_12-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- branches/version-2_12-dev/html/install/sql/create_table_pgsql.sql	(revision 21795)
+++ branches/version-2_12-dev/html/install/sql/create_table_pgsql.sql	(revision 21810)
@@ -12,5 +12,6 @@
 
 CREATE TABLE dtb_ownersstore_settings (
-    public_key text
+    public_key text,
+    PRIMARY KEY(public_key)
 );
 
@@ -41,8 +42,10 @@
 
 CREATE TABLE mtb_zip (
+    zip_id int,
     zipcode text,
     state text,
     city text,
-    town text
+    town text,
+    PRIMARY KEY (zip_id)
 );
 
@@ -66,4 +69,5 @@
 
 CREATE TABLE dtb_baseinfo (
+    id int,
     company_name text,
     company_kana text,
@@ -129,5 +133,6 @@
     longitude text,
     downloadable_days numeric DEFAULT 30,
-    downloadable_days_unlimited smallint
+    downloadable_days_unlimited smallint,
+    PRIMARY KEY (id)
 );
 
@@ -174,5 +179,5 @@
     payment_method text,
     charge numeric,
-    rule numeric,
+    rule_max numeric,
     rank int,
     note text,
@@ -387,5 +392,6 @@
     creator_id int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (recommend_product_id)
 );
 
@@ -628,5 +634,6 @@
     memo09 text,
     memo10 text,
-    session text
+    session text,
+    PRIMARY KEY (order_temp_id)
 );
 
@@ -1085,5 +1092,6 @@
     param_value text,
     url text,
-    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    PRIMARY KEY (session_id)
 );
 
@@ -1096,5 +1104,6 @@
     del_flg smallint NOT NULL DEFAULT 0,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (module_id)
 );
 
