diff --git a/CHANGELOG.md b/CHANGELOG.md index 0697d1b..3b47dd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Stripe for Craft Commerce +## 4.1.2.3 - 2024-06-18 + +- Fixed a SQL performance issue when upgrading. ([#190](https://github.com/craftcms/commerce-stripe/issues/190)) + ## 4.1.2.2 - 2024-04-09 - Fixed a PHP error that could occur when handling a webhook request. ([#294](https://github.com/craftcms/commerce-stripe/issues/294)) 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 6d1a2f5..d9a713a 100644 --- a/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php +++ b/src/migrations/m210903_040320_payment_intent_unique_on_transaction.php @@ -19,9 +19,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}}'; @@ -45,6 +42,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);