Skip to content

Commit 9593250

Browse files
authored
Merge pull request #130 from magento-arcticfoxes/B2B-1663
B2B-1663: Add Primary Key on Magento CE DB Tables
2 parents 3948ee7 + ece2528 commit 9593250

File tree

13 files changed

+20
-10
lines changed

13 files changed

+20
-10
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/CatalogUrlRewrite/etc/db_schema.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
comment="category_id"/>
1616
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false"
1717
comment="product_id"/>
18+
<constraint xsi:type="primary" referenceId="PRIMARY">
19+
<column name="url_rewrite_id"/>
20+
</constraint>
1821
<constraint xsi:type="foreign" referenceId="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
1922
table="catalog_url_rewrite_product_category" column="product_id"
2023
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID": true
1010
},
1111
"constraint": {
12+
"PRIMARY": true,
1213
"CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID": true,
1314
"FK_BB79E64705D7F17FE181F23144528FC8": true,
1415
"CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID": true,
1516
"CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_SEQUENCE_CAT_CTGR_SEQUENCE_VAL": true,
1617
"CAT_URL_REWRITE_PRD_CTGR_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL": true
1718
}
1819
}
19-
}
20+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
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>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"consumer_id": true
5555
},
5656
"constraint": {
57+
"PRIMARY": true,
5758
"OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID": true,
5859
"OAUTH_NONCE_NONCE_CONSUMER_ID": true
5960
},
@@ -94,4 +95,4 @@
9495
"OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE": true
9596
}
9697
}
97-
}
98+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +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">
15+
<constraint xsi:type="primary" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID">
1616
<column name="customer_id"/>
1717
</constraint>
1818
</table>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"customer_id": true
55
},
66
"constraint": {
7+
"PRIMARY": true,
78
"LOGIN_AS_CSTR_ASSISTANCE_ALLOWED_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
89
"LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID": true
910
}
1011
}
11-
}
12+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +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">
28+
<constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID">
2929
<column name="value_id"/>
3030
<column name="store_id"/>
3131
</constraint>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
"metadata": true
1111
},
1212
"constraint": {
13+
"PRIMARY": true,
1314
"FK_6FDF205946906B0E653E60AA769899F8": true,
1415
"CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID": true,
1516
"CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID": true
1617
}
1718
}
18-
}
19+
}

0 commit comments

Comments
 (0)