From 17b46f23556b9f18504c9290f1c07a21b79f8430 Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Tue, 18 Jun 2024 19:41:57 +0800 Subject: [PATCH 1/3] Fix performance issue #190 --- .../m210903_040320_payment_intent_unique_on_transaction.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php b/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php index 67af0f5..1001e2c 100644 --- a/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php +++ b/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php @@ -23,9 +23,6 @@ public function safeUp() $this->addColumn('{{%stripe_paymentintents}}', 'transactionHash', $this->string()->after('orderId')); } - MigrationHelper::dropAllForeignKeysOnTable('{{%stripe_paymentintents}}', $this); - MigrationHelper::dropAllIndexesOnTable('{{%stripe_paymentintents}}', $this); - $transactionsTable = '{{%commerce_transactions}}'; $stripePaymentIntentsTable = '{{%stripe_paymentintents}}'; @@ -49,6 +46,9 @@ public function safeUp() $this->execute($sql); + MigrationHelper::dropAllForeignKeysOnTable('{{%stripe_paymentintents}}', $this); + MigrationHelper::dropAllIndexesOnTable('{{%stripe_paymentintents}}', $this); + $this->addForeignKey(null, '{{%stripe_paymentintents}}', 'gatewayId', '{{%commerce_gateways}}', 'id', 'CASCADE', null); $this->addForeignKey(null, '{{%stripe_paymentintents}}', 'customerId', '{{%stripe_customers}}', 'id', 'CASCADE', null); $this->addForeignKey(null, '{{%stripe_paymentintents}}', 'orderId', '{{%commerce_orders}}', 'id', 'CASCADE', null); From 84aa8b6d0cabcf29e6ad23c3f34cbe026237c71c Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Tue, 18 Jun 2024 19:43:17 +0800 Subject: [PATCH 2/3] Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6756931..34cf8fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Stripe for Craft Commerce +## 2.4.5.1 - 2025-06-18 + +- Fixed a SQL performance issue when upgrading. ([#190](https://github.com/craftcms/commerce-stripe/issues/190)) + ## 2.4.5 - 2024-04-09 - Fixed a PHP error that could occur when handling a webhook request. ([#294](https://github.com/craftcms/commerce-stripe/issues/294)) From ce0a85c83ef98f75f37331cda864a3f9ce222b33 Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Tue, 18 Jun 2024 19:45:31 +0800 Subject: [PATCH 3/3] Fix date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34cf8fe..faa3833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes for Stripe for Craft Commerce -## 2.4.5.1 - 2025-06-18 +## 2.4.5.1 - 2024-06-18 - Fixed a SQL performance issue when upgrading. ([#190](https://github.com/craftcms/commerce-stripe/issues/190))