Skip to content

Commit c25d9c7

Browse files
committed
fix SVC failure issue
1 parent 69a0612 commit c25d9c7

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/SchemaBuilder.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ class SchemaBuilder
4848
*/
4949
private $tables;
5050

51+
/**
52+
* declared tables.
53+
*
54+
* @var array
55+
*/
56+
private array $tablesWithJsonTypeField = [];
57+
5158
/**
5259
* Constructor.
5360
*
@@ -96,8 +103,9 @@ public function build(Schema $schema)
96103
'collation' => $tableOptions['collation']
97104
]
98105
);
106+
99107
$isJsonType = false;
100-
$tablesWithJsonTypeField = $schema->getTablesWithJsonTypeField();
108+
$tablesWithJsonTypeField = $this->getTablesWithJsonTypeField();
101109
if (count($tablesWithJsonTypeField) > 0 && isset($tablesWithJsonTypeField[$tableName])) {
102110
$isJsonType = true;
103111
}
@@ -215,4 +223,25 @@ private function resolveInternalRelations(array $columns, array $data)
215223

216224
return $referenceColumns;
217225
}
226+
227+
/**
228+
* Get tables name with JSON type fields.
229+
*
230+
* @return array
231+
*/
232+
public function getTablesWithJsonTypeField(): array
233+
{
234+
return $this->tablesWithJsonTypeField;
235+
}
236+
237+
/**
238+
* Set tables name with JSON type fields.
239+
*
240+
* @param array $tablesWithJsonTypeField
241+
* @return array
242+
*/
243+
public function setTablesWithJsonTypeField(array $tablesWithJsonTypeField): array
244+
{
245+
return $this->tablesWithJsonTypeField = $tablesWithJsonTypeField;
246+
}
218247
}

lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Schema.php

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Schema
1818
{
1919
/**
20-
* Get resource connection.
20+
* Resource connection.
2121
*
2222
* @var ResourceConnection
2323
*/
@@ -30,13 +30,6 @@ class Schema
3030
*/
3131
private $tables;
3232

33-
/**
34-
* declared tables.
35-
*
36-
* @var array
37-
*/
38-
private $tablesWithJsonTypeField = [];
39-
4033
/**
4134
* Schema constructor.
4235
*
@@ -83,25 +76,4 @@ public function getTableByName($name)
8376
$name = $this->resourceConnection->getTableName($name);
8477
return $this->tables[$name] ?? false;
8578
}
86-
87-
/**
88-
* Get tables name with JSON type fields.
89-
*
90-
* @return array
91-
*/
92-
public function getTablesWithJsonTypeField(): array
93-
{
94-
return $this->tablesWithJsonTypeField;
95-
}
96-
97-
/**
98-
* Set tables name with JSON type fields.
99-
*
100-
* @param array $tablesWithJsonTypeField
101-
* @return array
102-
*/
103-
public function setTablesWithJsonTypeField(array $tablesWithJsonTypeField): array
104-
{
105-
return $this->tablesWithJsonTypeField = $tablesWithJsonTypeField;
106-
}
10779
}

lib/internal/Magento/Framework/Setup/Declaration/Schema/SchemaConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getDbConfig()
7272
}
7373
}
7474
$schema = $this->schemaFactory->create();
75-
$schema->setTablesWithJsonTypeField($tablesWithJsonTypeField);
75+
$this->dbSchemaBuilder->setTablesWithJsonTypeField($tablesWithJsonTypeField);
7676
$schema = $this->dbSchemaBuilder->build($schema);
7777
return $schema;
7878
}

0 commit comments

Comments
 (0)