From fb6ccb9eb01b251d959cee08bbf8b3bc29265ec3 Mon Sep 17 00:00:00 2001 From: fujisawa Date: Mon, 4 Mar 2019 16:01:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?SQL=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/install/sql/create_table_mysqli.sql | 7 ++++--- html/install/sql/create_table_pgsql.sql | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/html/install/sql/create_table_mysqli.sql b/html/install/sql/create_table_mysqli.sql index 3795005099..cc209b9e2e 100644 --- a/html/install/sql/create_table_mysqli.sql +++ b/html/install/sql/create_table_mysqli.sql @@ -676,7 +676,7 @@ CREATE TABLE dtb_shipping ( create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, update_date timestamp NOT NULL, del_flg smallint NOT NULL DEFAULT 0, - PRIMARY KEY (shipping_id, order_id) + PRIMARY KEY (order_id, shipping_id) ); CREATE TABLE dtb_shipment_item ( @@ -689,7 +689,7 @@ CREATE TABLE dtb_shipment_item ( classcategory_name2 text, price numeric, quantity numeric, - PRIMARY KEY (shipping_id, product_class_id, order_id) + PRIMARY KEY (order_id,shipping_id, product_class_id) ); CREATE TABLE dtb_other_deliv ( @@ -1232,7 +1232,8 @@ CREATE TABLE dtb_tax_rule ( update_date timestamp NOT NULL, PRIMARY KEY (tax_rule_id) ); - +CREATE INDEX dtb_order_detail_order_id_key ON dtb_order_detail(order_id); +CREATE INDEX dtb_order_customer_id_key ON dtb_order_detail(customer_id); 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); diff --git a/html/install/sql/create_table_pgsql.sql b/html/install/sql/create_table_pgsql.sql index 350ed567b3..7d815e8022 100644 --- a/html/install/sql/create_table_pgsql.sql +++ b/html/install/sql/create_table_pgsql.sql @@ -676,7 +676,7 @@ CREATE TABLE dtb_shipping ( create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, update_date timestamp NOT NULL, del_flg smallint NOT NULL DEFAULT 0, - PRIMARY KEY (shipping_id, order_id) + PRIMARY KEY (order_id, shipping_id) ); CREATE TABLE dtb_shipment_item ( @@ -689,7 +689,7 @@ CREATE TABLE dtb_shipment_item ( classcategory_name2 text, price numeric, quantity numeric, - PRIMARY KEY (shipping_id, product_class_id, order_id) + PRIMARY KEY (order_id,shipping_id, product_class_id) ); CREATE TABLE dtb_other_deliv ( @@ -1232,7 +1232,8 @@ CREATE TABLE dtb_tax_rule ( update_date timestamp NOT NULL, PRIMARY KEY (tax_rule_id) ); - +CREATE INDEX dtb_order_customer_id_key ON dtb_order(customer_id); +CREATE INDEX dtb_order_detail_order_id_key ON dtb_order_detail(order_id); CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_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); From 8cff2853a8229102585d63fe187c1ab190cdfed7 Mon Sep 17 00:00:00 2001 From: fujisawa Date: Mon, 4 Mar 2019 16:45:04 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E3=83=9F=E3=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/install/sql/create_table_mysqli.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/install/sql/create_table_mysqli.sql b/html/install/sql/create_table_mysqli.sql index cc209b9e2e..1f0471d6f9 100644 --- a/html/install/sql/create_table_mysqli.sql +++ b/html/install/sql/create_table_mysqli.sql @@ -1233,7 +1233,7 @@ CREATE TABLE dtb_tax_rule ( PRIMARY KEY (tax_rule_id) ); CREATE INDEX dtb_order_detail_order_id_key ON dtb_order_detail(order_id); -CREATE INDEX dtb_order_customer_id_key ON dtb_order_detail(customer_id); +CREATE INDEX dtb_order_customer_id_key ON dtb_order(customer_id); 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);