Skip to content

Commit b1ca0c7

Browse files
committed
Fix stock_id issue
1 parent b6ac3a3 commit b1ca0c7

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

Diff for: InventoryDataExporter/Model/Query/InventoryStockQuery.php

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private function getTable(string $tableName): string
5858
public function getQuery(array $skus): Select
5959
{
6060
$connection = $this->resourceConnection->getConnection();
61+
$selects = [];
6162
foreach ($this->getStocks() as $stockId) {
6263
$stockId = (int)$stockId;
6364
if ($this->defaultStockProvider->getId() === $stockId) {

Diff for: InventoryDataExporter/etc/db_schema.xml

+18-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="inventory_data_exporter_stock_status" resource="default" engine="innodb" comment="Inventory Stock Status Feed Storage">
11+
<column xsi:type="varchar"
12+
name="id"
13+
padding="10"
14+
nullable="false"
15+
length="64"
16+
comment="ID"
17+
/>
1118
<column xsi:type="int"
12-
name="id"
13-
padding="10"
14-
unsigned="true"
15-
nullable="false"
16-
comment="ID"
17-
onCreate="migrateDataFromJSON(JSON_EXTRACT(feed_data, '$.id'))"
19+
name="stock_id"
20+
padding="10"
21+
unsigned="true"
22+
nullable="false"
23+
comment="Stock ID"
24+
/>
25+
<column xsi:type="varchar"
26+
name="sku"
27+
nullable="false"
28+
length="64"
29+
comment="Product SKU"
1830
/>
1931
<column
2032
xsi:type="mediumtext"

Diff for: InventoryDataExporter/etc/db_schema_whitelist.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
},
99
"column": {
1010
"id": true,
11-
"sku": true,
12-
"item_id": true,
1311
"stock_id": true,
12+
"sku": true,
1413
"feed_data": true,
1514
"modified_at": true,
1615
"is_deleted": true

Diff for: InventoryDataExporter/etc/di.xml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
<arguments>
4141
<argument name="mapping" xsi:type="array">
4242
<item name="id" xsi:type="string">id</item>
43+
<item name="stock_id" xsi:type="string">stockId</item>
44+
<item name="sku" xsi:type="string">sku</item>
4345
</argument>
4446
</arguments>
4547
</virtualType>

0 commit comments

Comments
 (0)