Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL調整 #247

Merged
merged 2 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions html/install/sql/create_table_mysqli.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 (
Expand Down Expand Up @@ -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(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);
Expand Down
7 changes: 4 additions & 3 deletions html/install/sql/create_table_pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 (
Expand Down Expand Up @@ -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);
Expand Down