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 20051)
+++ /branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 20053)
@@ -65,5 +65,5 @@
     end_age smallint,
     member smallint,
-    order_date datetime,
+    order_date timestamp,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
 ) ENGINE=InnoDB;
@@ -83,5 +83,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
-    release_date datetime NOT NULL,
+    release_date timestamp NOT NULL,
     PRIMARY KEY (module_id)
 ) ENGINE=InnoDB;
@@ -273,6 +273,6 @@
     send_count int,
     complete_count int NOT NULL DEFAULT 0,
-    start_date datetime,
-    end_date datetime,
+    start_date timestamp,
+    end_date timestamp,
     search_data text,
     del_flg smallint NOT NULL DEFAULT 0,
@@ -436,5 +436,5 @@
     total numeric NOT NULL DEFAULT 0,
     total_average numeric NOT NULL DEFAULT 0,
-    order_date datetime NOT NULL,
+    order_date timestamp NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     year smallint NOT NULL,
@@ -461,5 +461,5 @@
     total_average numeric NOT NULL DEFAULT 0,
     hour smallint NOT NULL DEFAULT 0,
-    order_date datetime,
+    order_date timestamp,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
 ) ENGINE=InnoDB;
@@ -498,5 +498,6 @@
     product_id int NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    update_date timestamp NOT NULL
+    update_date timestamp NOT NULL,
+    PRIMARY KEY (customer_id, product_id)
 ) ENGINE=InnoDB;
 
@@ -515,5 +516,5 @@
 CREATE TABLE dtb_news (
     news_id int  NOT NULL,
-    news_date datetime,
+    news_date timestamp,
     rank int,
     news_title text NOT NULL,
@@ -546,5 +547,5 @@
     send_id int  NOT NULL,
     order_id int NOT NULL,
-    send_date datetime,
+    send_date timestamp,
     template_id int,
     creator_id int NOT NULL,
@@ -575,5 +576,5 @@
     sex smallint,
     job smallint,
-    birth datetime,
+    birth timestamp,
     password text,
     reminder smallint,
@@ -581,6 +582,6 @@
     salt text,
     secret_key varchar(50) NOT NULL UNIQUE,
-    first_buy_date datetime,
-    last_buy_date datetime,
+    first_buy_date timestamp,
+    last_buy_date timestamp,
     buy_times numeric DEFAULT 0,
     buy_total numeric DEFAULT 0,
@@ -618,5 +619,5 @@
     order_addr02 text,
     order_sex smallint,
-    order_birth datetime,
+    order_birth timestamp,
     order_job int,
     subtotal numeric,
@@ -636,6 +637,6 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
-    commit_date datetime,
-    payment_date datetime,
+    commit_date timestamp,
+    payment_date timestamp,
     device_type_id int,
     del_flg smallint NOT NULL DEFAULT 0,
@@ -674,5 +675,5 @@
     order_addr02 text,
     order_sex smallint,
-    order_birth datetime,
+    order_birth timestamp,
     order_job int,
     subtotal numeric,
@@ -733,6 +734,6 @@
     shipping_time text,
     shipping_num text,
-    shipping_date datetime,
-    shipping_commit_date datetime,
+    shipping_date timestamp,
+    shipping_commit_date timestamp,
     rank int,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -800,5 +801,5 @@
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
-    login_date datetime,
+    login_date timestamp,
     PRIMARY KEY (member_id)
 ) ENGINE=InnoDB;
@@ -915,5 +916,5 @@
 
 CREATE TABLE mtb_pref (
-    id smallint NOT NULL,
+    id smallint,
     name text,
     rank smallint NOT NULL DEFAULT 0,
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 20051)
+++ /branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	(revision 20053)
@@ -65,5 +65,5 @@
     end_age smallint,
     member smallint,
-    order_date timestamp DEFAULT now(),
+    order_date timestamp,
     create_date timestamp NOT NULL DEFAULT now()
 );
@@ -424,5 +424,4 @@
 );
 
-
 CREATE TABLE dtb_bat_order_daily (
     total_order numeric NOT NULL DEFAULT 0,
@@ -437,5 +436,5 @@
     total numeric NOT NULL DEFAULT 0,
     total_average numeric NOT NULL DEFAULT 0,
-    order_date timestamp NOT NULL DEFAULT now(),
+    order_date timestamp NOT NULL,
     create_date timestamp NOT NULL DEFAULT now(),
     year smallint NOT NULL,
@@ -462,5 +461,5 @@
     total_average numeric NOT NULL DEFAULT 0,
     hour smallint NOT NULL DEFAULT 0,
-    order_date timestamp DEFAULT now(),
+    order_date timestamp,
     create_date timestamp NOT NULL DEFAULT now()
 );
@@ -917,5 +916,5 @@
 
 CREATE TABLE mtb_pref (
-    id text,
+    id smallint,
     name text,
     rank smallint NOT NULL DEFAULT 0,
@@ -1176,5 +1175,5 @@
 
 CREATE TABLE mtb_ownersstore_err (
-    id text,
+    id smallint,
     name text,
     rank smallint NOT NULL DEFAULT 0,
@@ -1183,5 +1182,5 @@
 
 CREATE TABLE mtb_ownersstore_ips (
-    id text,
+    id smallint,
     name text,
     rank smallint NOT NULL DEFAULT 0,
@@ -1296,10 +1295,8 @@
 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);
