Questions tagged [foreign-key-constraint]

Foreign keys are a data integrity feature of relational (and SQL) databases. A foreign key is a set of attributes in a relational table that is subject to a referential integrity constraint. The referential integrity constraint mandates that the values of the foreign key attributes in one table, A, must match with corresponding values in some specified table B (which may sometimes be the same table as A).

Filter by
Sorted by
Tagged with
0
votes
2answers
19 views

why setup upgrade command revert back already dropped foreign key in magento 2.4.2

I have written one custom module with a simple UpgradeSchema file to drop core foreign key (table product_alert_stock, foreign key name - PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID ) ...
0
votes
2answers
31 views

Magento 2 - how to re-install missing foreign-key constraints?

I am using a third party extension. I noticed that a constraint is missing by comparing with a fresh installation. This causes a bug when deleting an item of the extension. Is there a command which is ...
0
votes
1answer
34 views

Magento 2 - Foreign Key Constraint does not delete record

I am using the extension Amasty Product Attachments. If I add an attachment to a product and then delete that attachment from Amasty -> Product Attachments -> Attachments Management, then I can'...
0
votes
0answers
15 views

Search for a deleted table's reference id in all tables, rows and columns of a DB

I had copied the table structure of table 'url_rewrite' and created a new table named 'url_rewrite_new' with empty data in my Magento 2 store DB, also renamed the 'url_rewrite' table. Then I ran ...
2
votes
0answers
50 views

After Upgrate Magento 2 from version 2.2.5 to 2.3.4 Integrity constraint violation: 1452 Cannot add or update a child row

I am trying to upgrade Magento 2 version from 2.2.5 to 2.3.4 using CLI. Version up-gradation is done. After version upgrade when I run bin/magento setup:upgrade it will give an error as follow: ...
0
votes
1answer
45 views

Foreign Key Constraint

the following error as seen in the screenshot came up during the data migration from M1 to M2 using data migration tool. Please share your views as to how I go about eliminating this error with a ...
0
votes
1answer
59 views

How to put a 'select' text inside a dropdown in the admin section? Magento2

I have a form in the admin section that has a phone numbers dropdown. This dropdown is pulling its values from a phone number table. I added a 'Select--' to the first option of the dropdown so the ...
1
vote
0answers
21 views

Unable to create duplicate product in Magento 1.9

I have tried to create a product using the duplicate product in Magento 1.9.3.1. It gives an error as follow
1
vote
1answer
381 views

Declarative schema: Incorrect Foreign Key Diff

We created a new table using M2's declarative scheme like this: <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/...
0
votes
1answer
550 views

Magento1: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

getting the error while uploading the media files to the products, I have tried repairing the tables and also tried increasing the INT value in table structure still giving the following error: ...
5
votes
1answer
929 views

Magento 2.3 Error on Delete All Test Data from Database

We are in the process of migrating to Magento 2.3, but need to remove all test data from the database and reset all increment ID's back to 1. Having some troubles removing all order information: SET ...