Skip to content

Commit

Permalink
Revert "Clean inventory transactions"
Browse files Browse the repository at this point in the history
This reverts commit 3be02d9.

# Conflicts:
#	src/console/controllers/ResetDataController.php
  • Loading branch information
lukeholder committed Sep 18, 2024
1 parent ff3994c commit f62c858
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- Fixed a bug where shipping method names were invalid when they contained the same name in another store. ([#3676](https://github.com/craftcms/commerce/issues/3676))
- Fixed a bug where modified parameters in the `\craft\commerce\events\CreateSubscriptionEvent` were not being passed to the gateway.
- Fixed a bug where aggregate store stock levels weren’t being updated when inventory was updated. ([#3668](https://github.com/craftcms/commerce/issues/3668))
- The `commerce/reset-data` command now clears inventory transactions.

## 5.1.1 - 2024-09-10

Expand Down
10 changes: 1 addition & 9 deletions src/console/controllers/ResetDataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ResetDataController extends Controller
*/
public function actionIndex(): int
{
$reset = $this->prompt('Resetting Commerce data will permanently delete all orders, subscriptions, payment sources, customer data, addresses, inventory stock levels and transactions, and and reset discount usages ... do you wish to continue?', [
$reset = $this->prompt('Resetting Commerce data will permanently delete all orders, subscriptions, payment sources, customers, addresses and reset discount usages ... do you wish to continue?', [
'required' => true,
'default' => 'no',
'validator' => function($input) {
Expand Down Expand Up @@ -61,14 +61,6 @@ public function actionIndex(): int

$this->stdout($count . ' orders deleted.' . PHP_EOL . PHP_EOL, Console::FG_GREEN);

// Inventory
$this->stdout('Deleting inventory transactions ...' . PHP_EOL, Console::FG_GREEN);
$count = Craft::$app->getDb()->createCommand()
->delete(Table::INVENTORYTRANSACTIONS)
->execute();

$this->stdout($count . ' inventory transactions deleted.' . PHP_EOL . PHP_EOL, Console::FG_GREEN);

// Subscriptions
$this->stdout('Deleting subscriptions ...' . PHP_EOL, Console::FG_GREEN);
$subscriptionIds = (new Query())
Expand Down

0 comments on commit f62c858

Please sign in to comment.