Skip to content

Commit f5c8189

Browse files
committed
B2B-1663: Add Primary Key on Magento CE DB Tables
1 parent 6497751 commit f5c8189

File tree

7 files changed

+6
-21
lines changed

7 files changed

+6
-21
lines changed

app/code/Magento/Catalog/etc/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@
16931693
<constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID"
16941694
table="catalog_product_entity_media_gallery_value_to_entity" column="entity_id"
16951695
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
1696-
<constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID">
1696+
<constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID">
16971697
<column name="value_id"/>
16981698
<column name="entity_id"/>
16991699
</constraint>

app/code/Magento/Catalog/etc/db_schema_whitelist.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@
10201020
"entity_id": true
10211021
},
10221022
"constraint": {
1023+
"PRIMARY": true,
10231024
"FK_A6C6C8FAA386736921D3A7C4B50B1185": true,
10241025
"CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID": true,
10251026
"CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID": true

app/code/Magento/Integration/etc/db_schema.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,13 @@
8484
<constraint xsi:type="foreign" referenceId="OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_nonce"
8585
column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id"
8686
onDelete="CASCADE"/>
87-
<constraint xsi:type="unique" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID">
87+
<constraint xsi:type="primary" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID">
8888
<column name="nonce"/>
8989
<column name="consumer_id"/>
9090
</constraint>
9191
<index referenceId="OAUTH_NONCE_TIMESTAMP" indexType="btree">
9292
<column name="timestamp"/>
9393
</index>
94-
<constraint xsi:type="primary" referenceId="PRIMARY">
95-
<column name="nonce"/>
96-
<column name="consumer_id"/>
97-
</constraint>
9894
</table>
9995
<table name="integration" resource="default" engine="innodb" comment="integration">
10096
<column xsi:type="int" name="integration_id" unsigned="true" nullable="false" identity="true"

app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
<constraint xsi:type="foreign" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
1313
table="login_as_customer_assistance_allowed" column="customer_id" referenceTable="customer_entity"
1414
referenceColumn="entity_id" onDelete="CASCADE"/>
15-
<constraint xsi:type="unique" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID">
16-
<column name="customer_id"/>
17-
</constraint>
18-
<constraint xsi:type="primary" referenceId="PRIMARY">
15+
<constraint xsi:type="primary" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID">
1916
<column name="customer_id"/>
2017
</constraint>
2118
</table>

app/code/Magento/ProductVideo/etc/db_schema.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
<constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID"
2626
table="catalog_product_entity_media_gallery_value_video" column="store_id" referenceTable="store"
2727
referenceColumn="store_id" onDelete="CASCADE"/>
28-
<constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID">
29-
<column name="value_id"/>
30-
<column name="store_id"/>
31-
</constraint>
32-
<constraint xsi:type="primary" referenceId="PRIMARY">
28+
<constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID">
3329
<column name="value_id"/>
3430
<column name="store_id"/>
3531
</constraint>

app/code/Magento/Widget/etc/db_schema.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@
7070
<constraint xsi:type="foreign" referenceId="WIDGET_INSTANCE_PAGE_LYT_LYT_UPDATE_ID_LYT_UPDATE_LYT_UPDATE_ID"
7171
table="widget_instance_page_layout" column="layout_update_id" referenceTable="layout_update"
7272
referenceColumn="layout_update_id" onDelete="CASCADE"/>
73-
<constraint xsi:type="unique" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID">
74-
<column name="layout_update_id"/>
75-
<column name="page_id"/>
76-
</constraint>
77-
<constraint xsi:type="primary" referenceId="PRIMARY">
73+
<constraint xsi:type="primary" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID">
7874
<column name="layout_update_id"/>
7975
<column name="page_id"/>
8076
</constraint>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
catalog_product_entity_media_gallery_value_to_entity
21
catalog_url_rewrite_product_category
32
queue_poison_pill

0 commit comments

Comments
 (0)