Skip to content

Commit

Permalink
Merge pull request #130 from magento-arcticfoxes/B2B-1663
Browse files Browse the repository at this point in the history
B2B-1663: Add Primary Key on Magento CE DB Tables
  • Loading branch information
joanhe authored Feb 3, 2021
2 parents 3948ee7 + ece2528 commit 9593250
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@
<constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID"
table="catalog_product_entity_media_gallery_value_to_entity" column="entity_id"
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID">
<constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID">
<column name="value_id"/>
<column name="entity_id"/>
</constraint>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Catalog/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@
"entity_id": true
},
"constraint": {
"PRIMARY": true,
"FK_A6C6C8FAA386736921D3A7C4B50B1185": true,
"CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID": true,
"CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID": true
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
comment="category_id"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false"
comment="product_id"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="url_rewrite_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
table="catalog_url_rewrite_product_category" column="product_id"
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
"CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID": true
},
"constraint": {
"PRIMARY": true,
"CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID": true,
"FK_BB79E64705D7F17FE181F23144528FC8": true,
"CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID": true,
"CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_SEQUENCE_CAT_CTGR_SEQUENCE_VAL": true,
"CAT_URL_REWRITE_PRD_CTGR_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL": true
}
}
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Integration/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<constraint xsi:type="foreign" referenceId="OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_nonce"
column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id"
onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID">
<constraint xsi:type="primary" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID">
<column name="nonce"/>
<column name="consumer_id"/>
</constraint>
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Integration/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"consumer_id": true
},
"constraint": {
"PRIMARY": true,
"OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID": true,
"OAUTH_NONCE_NONCE_CONSUMER_ID": true
},
Expand Down Expand Up @@ -94,4 +95,4 @@
"OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<constraint xsi:type="foreign" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
table="login_as_customer_assistance_allowed" column="customer_id" referenceTable="customer_entity"
referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID">
<constraint xsi:type="primary" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID">
<column name="customer_id"/>
</constraint>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"customer_id": true
},
"constraint": {
"PRIMARY": true,
"LOGIN_AS_CSTR_ASSISTANCE_ALLOWED_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
"LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID": true
}
}
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/ProductVideo/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID"
table="catalog_product_entity_media_gallery_value_video" column="store_id" referenceTable="store"
referenceColumn="store_id" onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID">
<constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID">
<column name="value_id"/>
<column name="store_id"/>
</constraint>
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/ProductVideo/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"metadata": true
},
"constraint": {
"PRIMARY": true,
"FK_6FDF205946906B0E653E60AA769899F8": true,
"CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID": true,
"CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID": true
}
}
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Widget/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<constraint xsi:type="foreign" referenceId="WIDGET_INSTANCE_PAGE_LYT_LYT_UPDATE_ID_LYT_UPDATE_LYT_UPDATE_ID"
table="widget_instance_page_layout" column="layout_update_id" referenceTable="layout_update"
referenceColumn="layout_update_id" onDelete="CASCADE"/>
<constraint xsi:type="unique" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID">
<constraint xsi:type="primary" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID">
<column name="layout_update_id"/>
<column name="page_id"/>
</constraint>
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Widget/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID": true
},
"constraint": {
"PRIMARY": true,
"WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID_WIDGET_INSTANCE_PAGE_PAGE_ID": true,
"WIDGET_INSTANCE_PAGE_LYT_LYT_UPDATE_ID_LYT_UPDATE_LYT_UPDATE_ID": true,
"WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID": true
Expand Down Expand Up @@ -95,4 +96,4 @@
"LAYOUT_LINK_THEME_ID_THEME_THEME_ID": true
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
queue_poison_pill

0 comments on commit 9593250

Please sign in to comment.