Reputation: 9
First of all, sorry for this being in Dutch, I doubt understanding the language is needed for this though.
whenever I Forward-Engineer, it gives me error 1452. The thing is, I am using existing parent table data to fill the child table.
is the insert from the PARENT table, which is not empty as you can see.
is the insert from the CHILD table, filled with existing data of PARENT table.
And finally the error I get when forward-engineering .
I've been stuck for so long, would really appreciate an answer. Hope I gave enough information (first time asking question).
Upvotes: 0
Views: 630
Reputation: 561
Mysql 1452 error refers to that you're trying to insert child records whose parent id(s) are not in the parent table.
try matching your columns with the following query.
SELECT
DISTINCT ct.id
FROM
child_table as ct
LEFT JOIN parent_table as pt ON ct.parent_id=pt.id
WHERE
pt.id IS NULL;
Hope this helps!
Upvotes: 2