[COT] Add unique key constraints for the addresses and operational data tables (#34144)

* Add unique constraints to the COT addresses and operational tables

* Add changelog file
This commit is contained in:
Néstor Soriano 2022-08-04 13:22:08 +02:00 committed by GitHub
parent 75f6ec3a43
commit 0e0212254e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Add unique constraints to the COT addresses and operational tables

View File

@ -1407,7 +1407,7 @@ CREATE TABLE $addresses_table_name (
email varchar(320) null,
phone varchar(100) null,
KEY order_id (order_id),
KEY address_type_order_id (address_type, order_id)
UNIQUE KEY address_type_order_id (address_type, order_id)
) $collate;
CREATE TABLE $operational_data_table_name (
id bigint(20) unsigned auto_increment primary key,
@ -1428,8 +1428,8 @@ CREATE TABLE $operational_data_table_name (
discount_tax_amount decimal(26, 8) NULL,
discount_total_amount decimal(26, 8) NULL,
recorded_sales tinyint(1) NULL,
KEY order_id (order_id),
KEY order_key (order_key)
UNIQUE KEY order_id (order_id),
UNIQUE KEY order_key (order_key)
) $collate;
CREATE TABLE $meta_table (
id bigint(20) unsigned auto_increment primary key,