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 21512)
+++ branches/version-2_12-dev/html/install/sql/create_table_mysql.sql	(revision 21553)
@@ -1,4 +1,4 @@
 create table dtb_module_update_logs(
-    log_id int  NOT NULL,
+    log_id int NOT NULL,
     module_id int NOT NULL,
     buckup_path text,
@@ -9,12 +9,12 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (log_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_ownersstore_settings (
     public_key text
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_kiyaku (
-    kiyaku_id int  NOT NULL,
+    kiyaku_id int NOT NULL,
     kiyaku_title text NOT NULL,
     kiyaku_text text NOT NULL,
@@ -25,8 +25,8 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (kiyaku_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_holiday (
-    holiday_id int  NOT NULL,
+    holiday_id int NOT NULL,
     title text NOT NULL,
     month smallint NOT NULL,
@@ -38,5 +38,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (holiday_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_zip (
@@ -45,5 +45,5 @@
     city text,
     town text
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_update (
@@ -63,5 +63,5 @@
     release_date datetime NOT NULL,
     PRIMARY KEY (module_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_baseinfo (
@@ -130,8 +130,8 @@
     downloadable_days numeric DEFAULT 30,
     downloadable_days_unlimited smallint
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_deliv (
-    deliv_id int  NOT NULL,
+    deliv_id int NOT NULL,
     product_type_id int,
     name text,
@@ -146,5 +146,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (deliv_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_payment_options (
@@ -153,5 +153,5 @@
     rank int,
     PRIMARY KEY (deliv_id, payment_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_delivtime (
@@ -160,16 +160,16 @@
     deliv_time text NOT NULL,
     PRIMARY KEY (deliv_id, time_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_delivfee (
     deliv_id int NOT NULL,
-    fee_id int  NOT NULL,
+    fee_id int NOT NULL,
     fee numeric NOT NULL,
     pref smallint,
     PRIMARY KEY (deliv_id, fee_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_payment (
-    payment_id int  NOT NULL,
+    payment_id int NOT NULL,
     payment_method text,
     charge numeric,
@@ -201,5 +201,5 @@
     memo10 text,
     PRIMARY KEY (payment_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_mailtemplate (
@@ -213,5 +213,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (template_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_mailmaga_template (
@@ -225,8 +225,8 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (template_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_send_history (
-    send_id int  NOT NULL,
+    send_id int NOT NULL,
     mail_method smallint,
     subject text,
@@ -242,5 +242,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (send_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_send_customer (
@@ -251,8 +251,8 @@
     send_flag smallint,
     PRIMARY KEY (send_id, customer_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_products (
-    product_id int  NOT NULL,
+    product_id int NOT NULL,
     name text NOT NULL,
     maker_id int,
@@ -300,8 +300,8 @@
     deliv_date_id int,
     PRIMARY KEY (product_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_products_class (
-    product_class_id int  NOT NULL,
+    product_class_id int NOT NULL,
     product_id int NOT NULL,
     classcategory_id1 int NOT NULL DEFAULT 0,
@@ -322,9 +322,10 @@
     down_realfilename text,
     del_flg smallint NOT NULL DEFAULT 0,
-    PRIMARY KEY (product_class_id)
-) ENGINE=InnoDB;
+    PRIMARY KEY (product_class_id),
+    UNIQUE (product_id, classcategory_id1, classcategory_id2)
+);
 
 CREATE TABLE dtb_class (
-    class_id int  NOT NULL,
+    class_id int NOT NULL,
     name text,
     rank int,
@@ -334,8 +335,8 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (class_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_classcategory (
-    classcategory_id int  NOT NULL,
+    classcategory_id int NOT NULL,
     name text,
     class_id int NOT NULL,
@@ -346,8 +347,8 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (classcategory_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_category (
-    category_id int  NOT NULL,
+    category_id int NOT NULL,
     category_name text,
     parent_category_id int NOT NULL DEFAULT 0,
@@ -359,5 +360,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (category_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_product_categories (
@@ -366,5 +367,5 @@
     rank int NOT NULL,
     PRIMARY KEY(product_id, category_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_product_status (
@@ -375,6 +376,6 @@
     update_date timestamp NOT NULL,
     del_flg smallint NOT NULL DEFAULT 0,
-    PRIMARY KEY(product_status_id, product_id)
-) ENGINE=InnoDB;
+    PRIMARY KEY (product_status_id, product_id)
+);
 
 CREATE TABLE dtb_recommend_products (
@@ -387,8 +388,8 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_review (
-    review_id int  NOT NULL,
+    review_id int NOT NULL,
     product_id int NOT NULL,
     reviewer_name text NOT NULL,
@@ -405,5 +406,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (review_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_customer_favorite_products (
@@ -413,5 +414,5 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (customer_id, product_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_category_count (
@@ -419,5 +420,5 @@
     product_count int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_category_total_count (
@@ -425,8 +426,8 @@
     product_count int,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_news (
-    news_id int  NOT NULL,
+    news_id int NOT NULL,
     news_date datetime,
     rank int,
@@ -441,8 +442,8 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (news_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_best_products (
-    best_id int  NOT NULL,
+    best_id int NOT NULL,
     category_id int NOT NULL,
     rank int NOT NULL DEFAULT 0,
@@ -455,8 +456,8 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (best_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_mail_history (
-    send_id int  NOT NULL,
+    send_id int NOT NULL,
     order_id int NOT NULL,
     send_date datetime,
@@ -466,8 +467,8 @@
     mail_body text,
     PRIMARY KEY (send_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_customer (
-    customer_id int  NOT NULL,
+    customer_id int NOT NULL,
     name01 text NOT NULL,
     name02 text NOT NULL,
@@ -494,5 +495,5 @@
     reminder_answer text,
     salt text,
-    secret_key varchar(50) NOT NULL UNIQUE,
+    secret_key text NOT NULL,
     first_buy_date datetime,
     last_buy_date datetime,
@@ -507,9 +508,10 @@
     mobile_phone_id text,
     mailmaga_flg smallint,
-    PRIMARY KEY (customer_id)
-) ENGINE=InnoDB;
+    PRIMARY KEY (customer_id),
+    UNIQUE (secret_key(255))
+);
 
 CREATE TABLE dtb_order (
-    order_id int  NOT NULL,
+    order_id int NOT NULL,
     order_temp_id text,
     customer_id int NOT NULL,
@@ -566,5 +568,5 @@
     memo10 text,
     PRIMARY KEY (order_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_order_temp (
@@ -625,5 +627,5 @@
     memo10 text,
     session text
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_shipping (
@@ -645,5 +647,4 @@
     shipping_addr01 text,
     shipping_addr02 text,
-    deliv_id int NOT NULL,
     time_id int,
     shipping_time text,
@@ -656,5 +657,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (shipping_id, order_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_shipment_item (
@@ -669,8 +670,8 @@
     quantity numeric,
     PRIMARY KEY (shipping_id, product_class_id, order_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_other_deliv (
-    other_deliv_id int  NOT NULL,
+    other_deliv_id int NOT NULL,
     customer_id int NOT NULL,
     name01 text,
@@ -687,5 +688,5 @@
     tel03 text,
     PRIMARY KEY (other_deliv_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_order_detail (
@@ -702,8 +703,8 @@
     point_rate numeric,
     PRIMARY KEY (order_detail_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_member (
-    member_id int  NOT NULL,
+    member_id int NOT NULL,
     name text,
     department text,
@@ -720,9 +721,9 @@
     login_date datetime,
     PRIMARY KEY (member_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_pagelayout (
     device_type_id int NOT NULL,
-    page_id int  NOT NULL,
+    page_id int NOT NULL,
     page_name text,
     url text NOT NULL,
@@ -738,12 +739,12 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (device_type_id, page_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_bloc (
     device_type_id int NOT NULL,
-    bloc_id int  NOT NULL,
+    bloc_id int NOT NULL,
     bloc_name text,
     tpl_path text,
-    filename varchar(50) NOT NULL,
+    filename text NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
@@ -751,6 +752,6 @@
     deletable_flg smallint NOT NULL DEFAULT 1,
     PRIMARY KEY (device_type_id, bloc_id),
-    UNIQUE (device_type_id, filename)
-) ENGINE=InnoDB;
+    UNIQUE (device_type_id, filename(255))
+);
 
 CREATE TABLE dtb_blocposition (
@@ -762,5 +763,5 @@
     anywhere smallint DEFAULT 0 NOT NULL,
     PRIMARY KEY (device_type_id, page_id, target_id, bloc_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_csv (
@@ -778,5 +779,5 @@
     error_check_types text,
     PRIMARY KEY (no)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_csv_sql (
@@ -787,14 +788,14 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (sql_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_templates (
-    template_code varchar(50) NOT NULL,
+    template_code text NOT NULL,
     device_type_id int NOT NULL,
     template_name text,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
-    PRIMARY KEY (template_code)
-) ENGINE=InnoDB;
+    PRIMARY KEY (template_code(255))
+);
 
 CREATE TABLE dtb_maker (
@@ -807,5 +808,5 @@
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (maker_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_maker_count (
@@ -813,5 +814,5 @@
     product_count int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_pref (
@@ -820,5 +821,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_permission (
@@ -826,6 +827,6 @@
     name text,
     rank smallint NOT NULL DEFAULT 0,
-    PRIMARY KEY (id(32))
-) ENGINE=InnoDB;
+    PRIMARY KEY (id(255))
+);
 
 CREATE TABLE mtb_disable_logout (
@@ -834,5 +835,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_authority (
@@ -841,5 +842,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_auth_excludes (
@@ -848,5 +849,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_work (
@@ -855,5 +856,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_disp (
@@ -862,5 +863,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_class (
@@ -869,5 +870,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_status (
@@ -876,5 +877,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_status_image (
@@ -883,5 +884,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_allowed_tag (
@@ -890,5 +891,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_page_max (
@@ -897,5 +898,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_magazine_type (
@@ -904,5 +905,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_mail_magazine_type (
@@ -911,5 +912,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_recommend (
@@ -918,5 +919,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_taxrule (
@@ -925,5 +926,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_mail_template (
@@ -932,5 +933,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_mail_tpl_path (
@@ -939,5 +940,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_job (
@@ -946,5 +947,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_reminder (
@@ -953,5 +954,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_sex (
@@ -960,5 +961,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_customer_status (
@@ -967,5 +968,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_mail_type (
@@ -974,5 +975,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_order_status (
@@ -981,5 +982,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_product_status_color (
@@ -988,5 +989,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_order_status_color (
@@ -995,5 +996,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_wday (
@@ -1002,5 +1003,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_delivery_date (
@@ -1009,5 +1010,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_product_list_max (
@@ -1016,5 +1017,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_db (
@@ -1023,5 +1024,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_target (
@@ -1030,5 +1031,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_review_deny_url (
@@ -1037,5 +1038,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_mobile_domain (
@@ -1044,5 +1045,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_ownersstore_err (
@@ -1051,5 +1052,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_ownersstore_ips (
@@ -1058,5 +1059,5 @@
     rank smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_constants (
@@ -1065,6 +1066,6 @@
     rank smallint NOT NULL DEFAULT 0,
     remarks text,
-    PRIMARY KEY (id(64))
-) ENGINE=InnoDB;
+    PRIMARY KEY (id(255))
+);
 
 CREATE TABLE mtb_product_type (
@@ -1073,5 +1074,5 @@
     rank smallint NOT NULL,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE mtb_device_type (
@@ -1080,5 +1081,5 @@
     rank smallint NOT NULL,
     PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_mobile_ext_session_id (
@@ -1088,5 +1089,5 @@
     url text,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_module (
@@ -1099,31 +1100,31 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_session (
-    sess_id varchar(50) NOT NULL,
+    sess_id text NOT NULL,
     sess_data text,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
-    PRIMARY KEY (sess_id)
-) ENGINE=InnoDB;
+    PRIMARY KEY (sess_id(255))
+);
 
 CREATE TABLE dtb_bkup (
-    bkup_name varchar(50),
+    bkup_name text,
     bkup_memo text,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    PRIMARY KEY (bkup_name)
-) ENGINE=InnoDB;
+    PRIMARY KEY (bkup_name(255))
+);
 
 CREATE TABLE dtb_plugin (
     plugin_id int NOT NULL,
-    plugin_name varchar(255) NOT NULL,
-    plugin_code varchar(255) NOT NULL,
-    author varchar(255),
-    author_site_url varchar(255),
-    plugin_site_url varchar(255),
-    plugin_version varchar(255),
-    compliant_version varchar(255),
-    plugin_description varchar(255),
+    plugin_name text NOT NULL,
+    plugin_code text NOT NULL,
+    author text,
+    author_site_url text,
+    plugin_site_url text,
+    plugin_version text,
+    compliant_version text,
+    plugin_description text,
     priority int NOT NULL DEFAULT 0,
     enable smallint NOT NULL DEFAULT 0,
@@ -1131,29 +1132,30 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (plugin_id)
-) ENGINE=InnoDB;
+);
 
 CREATE TABLE dtb_plugin_hookpoint (
     id int NOT NULL,
     plugin_id int NOT NULL,
-    hook_point varchar(255) NOT NULL,
-    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL,
-    PRIMARY KEY (id)
-) ENGINE=InnoDB;
-
-CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
+    hook_point text NOT NULL,
+    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (id)
+);
+
+CREATE TABLE dtb_index_list (
+    table_name text NOT NULL,
+    column_name text NOT NULL,
+    recommend_flg smallint NOT NULL DEFAULT 0,
+    recommend_comment text,
+    PRIMARY KEY (table_name(255), column_name(255))
+);
+
+
+CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(255));
 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_param_key_key ON dtb_mobile_ext_session_id (param_key(255));
+CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value(255));
+CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url(255));
 CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
-
-CREATE TABLE dtb_index_list (
-    table_name varchar(30) NOT NULL,
-    column_name varchar(30) NOT NULL,
-    recommend_flg smallint NOT NULL DEFAULT 0,
-    recommend_comment text,
-    PRIMARY KEY (table_name, column_name)
-) ENGINE=InnoDB;
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 21512)
+++ branches/version-2_12-dev/html/install/sql/create_table_pgsql.sql	(revision 21553)
@@ -149,8 +149,8 @@
 
 CREATE TABLE dtb_payment_options (
+    deliv_id int NOT NULL,
     payment_id int NOT NULL,
-    deliv_id int NOT NULL,
     rank int,
-    PRIMARY KEY (payment_id, deliv_id)
+    PRIMARY KEY (deliv_id, payment_id)
 );
 
@@ -322,5 +322,6 @@
     down_realfilename text,
     del_flg smallint NOT NULL DEFAULT 0,
-    PRIMARY KEY (product_class_id)
+    PRIMARY KEY (product_class_id),
+    UNIQUE (product_id, classcategory_id1, classcategory_id2)
 );
 
@@ -494,5 +495,5 @@
     reminder_answer text,
     salt text,
-    secret_key text NOT NULL UNIQUE,
+    secret_key text NOT NULL,
     first_buy_date timestamp,
     last_buy_date timestamp,
@@ -507,5 +508,6 @@
     mobile_phone_id text,
     mailmaga_flg smallint,
-    PRIMARY KEY (customer_id)
+    PRIMARY KEY (customer_id),
+    UNIQUE (secret_key)
 );
 
@@ -645,5 +647,4 @@
     shipping_addr01 text,
     shipping_addr02 text,
-    deliv_id int NOT NULL,
     time_id int,
     shipping_time text,
@@ -757,6 +758,6 @@
     device_type_id int NOT NULL,
     page_id int NOT NULL,
-    target_id int,
-    bloc_id int,
+    target_id int NOT NULL,
+    bloc_id int NOT NULL,
     bloc_row int,
     anywhere smallint DEFAULT 0 NOT NULL,
@@ -1110,6 +1111,6 @@
 
 CREATE TABLE dtb_bkup (
-    bkup_name   text,
-    bkup_memo   text,
+    bkup_name text,
+    bkup_memo text,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     PRIMARY KEY (bkup_name)
@@ -1124,5 +1125,5 @@
     plugin_site_url text,
     plugin_version text,
-    compliant_version text,    
+    compliant_version text,
     plugin_description text,
     priority int NOT NULL DEFAULT 0,
@@ -1140,4 +1141,12 @@
     update_date timestamp NOT NULL,
     PRIMARY KEY (plugin_id)
+);
+
+CREATE TABLE dtb_index_list (
+    table_name text NOT NULL,
+    column_name text NOT NULL,
+    recommend_flg smallint NOT NULL DEFAULT 0,
+    recommend_comment text,
+    PRIMARY KEY (table_name, column_name)
 );
 
@@ -1151,10 +1160,2 @@
 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 TABLE dtb_index_list (
-    table_name text NOT NULL,
-    column_name text NOT NULL,
-    recommend_flg smallint NOT NULL DEFAULT 0,
-    recommend_comment text,
-    PRIMARY KEY (table_name, column_name)
-);
