Skip to content

Commit

Permalink
skip changes AC-11654: Integration test failing testDbSchemaUpToDate …
Browse files Browse the repository at this point in the history
…due to JSON column type
  • Loading branch information
glo60612 committed Jun 4, 2024
1 parent 42b1c58 commit f20e1d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ public function __construct(

/**
* @inheritdoc
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function build(Schema $schema, $tablesWithJsonTypeField = [])
public function build(Schema $schema)
{
foreach ($this->sharding->getResources() as $resource) {
foreach ($this->dbSchemaReader->readTables($resource) as $tableName) {
Expand All @@ -96,16 +95,9 @@ public function build(Schema $schema, $tablesWithJsonTypeField = [])
'collation' => $tableOptions['collation']
]
);
$isJsonType = false;
if (count($tablesWithJsonTypeField) > 0 && isset($tablesWithJsonTypeField[$tableName])) {
$isJsonType = true;
}

// Process columns
foreach ($columnsData as $columnData) {
if ($isJsonType && $tablesWithJsonTypeField[$tableName] == $columnData['name']) {
$columnData['type'] = 'json';
}
$columnData['table'] = $table;
$column = $this->elementFactory->create($columnData['type'], $columnData);
$columns[$column->getName()] = $column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,8 @@ public function __construct(
*/
public function getDbConfig()
{
$declarativeSchema = $this->getDeclarationConfig();
$tablesWithJsonTypeField = [];
foreach ($declarativeSchema->getTables() as $table) {
foreach ($table->getColumns() as $column) {
if ($column->getType() == 'json') {
$tablesWithJsonTypeField[$table->getName()] = $column->getName();
}
}
}
$schema = $this->schemaFactory->create();
$schema = $this->dbSchemaBuilder->build($schema, $tablesWithJsonTypeField);
$schema = $this->dbSchemaBuilder->build($schema);
return $schema;
}

Expand Down

0 comments on commit f20e1d6

Please sign in to comment.