Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

foreign key constraint on clean_urls table breaks populate database macro during product phase #5

Open
codgunt opened this issue Dec 15, 2015 · 0 comments

Comments

@codgunt
Copy link

codgunt commented Dec 15, 2015

The macro for populating the database with test data will fail if existing data is present due to the product delete query occuring before the "clean_urls" table is updated. I am not sure how to fix this properly yet due to just starting with the this version of the codebase but the temp work around is to manually clear out any clean_urls with a productid set before re-running the test data script.

Example output:

generate-dump-etalon.php --categories=10 --depth=2 --categoryImage -featuredProducts=30 --products=2000 --attributes=8 --options=5 --optionValues=3 --productImages=3 --wholesalePrices=4 --orders=15000 --orderItems=3

Clear categories ... done
Generate categories .............................................................................................................. done
Recalculate quick flags ... done
Clear products ...
ERROR: "0" (N/A) - An exception occurred while executing 'DELETE FROM xc_products':

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (rjv_xcart5.xc_clean_urls, CONSTRAINT FK_ED2984B14584665A FOREIGN KEY (product_id) REFERENCES xc_products (product_id))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant