concretecms-community-store / community_store_stripe_checkout

Stripe Checkout payment add-on for Community Store for Concrete CMS
MIT License
1 stars 1 forks source link

Integrity Constraint Violation installing #4

Closed madesimplemedia closed 5 years ago

madesimplemedia commented 5 years ago

Hi,

I have uninstalled the old Stripe payment addon, but get the following when installing the new addon:

An exception occurred while executing 'ALTER TABLE CommunityStoreOrderItemOptions ADD CONSTRAINT FK_61F5DBA5550DB923 FOREIGN KEY (oiID) REFERENCES CommunityStoreOrderItems (oiID) ON DELETE CASCADE': SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (easyprint_dev.#sql-7aef_175dc4, CONSTRAINTFK_61F5DBA5550DB923FOREIGN KEY (oiID) REFERENCESCommunityStoreOrderItems(oiID) ON DELETE CASCADE)

madesimplemedia commented 5 years ago

image

Mesuva commented 5 years ago

This isn't an issue with the Stripe add-on as such, it's only because it's triggering a refresh of the database and this is this catching some data issue. Have you potentially at some point deleted some order records, without also deleting the order line items?

madesimplemedia commented 5 years ago

Thanks for getting back to me. I guess that's possible, is there a way I can edit the DB to get it back to working?

Mesuva commented 5 years ago

Sure, something like PhpMyAdmin would get you into there, if you are using cPanel then that's going to be available. If you have your own custom hosting without any DB tools installed, I'm a fan of https://www.adminer.org/ - it's bare boned, but can do pretty much all the same things, and it's a single file to drop into your site's directory.

madesimplemedia commented 5 years ago

I have PHPMyAdmin.

In CommunityStoreOrderItems I have two row with oID = 4. In CommunityStoreOrders, I only have one with oID = 4. Do I need to delete one of the CommunityStoreOrderItems with oID = 4?

Mesuva commented 5 years ago

Well that sounds like you don't need to clean anything up.

Have you tried the trick of going to /index.php/dashboard/system/environment/entities and hitting the red Refresh Entities button?

madesimplemedia commented 5 years ago

Yeah that didn't seem to help.

I just uninstalled and installed 2.1.7 and it's working fine now.