Skip to content

Commit f72098f

Browse files
committed
ACP2E-3230: Modifying column length via db_schema.xml doesn't work in case of foreign keys
1 parent f832de5 commit f72098f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ public function compile(StatementAggregator $statementAggregator, $dryRun)
319319
*/
320320
private function isNeedToSplitSql() : bool
321321
{
322-
return str_contains($this->sqlVersionProvider->getSqlVersion(), SqlVersionProvider::MARIA_DB_10_VERSION);
322+
return str_contains($this->sqlVersionProvider->getSqlVersion(), SqlVersionProvider::MARIA_DB_10_4_VERSION) ||
323+
str_contains($this->sqlVersionProvider->getSqlVersion(), SqlVersionProvider::MARIA_DB_10_6_VERSION);
323324
}
324325

325326
/**

lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/DbSchemaWriterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function testCompileWithColumnModificationAndFK(string $dbVersion, int $n
130130
$statementAggregator->expects($this->any())
131131
->method('getStatementsBank')
132132
->willReturn([$statementBank]);
133-
$this->sqlVersionProvider->expects($this->once())
133+
$this->sqlVersionProvider->expects($this->any())
134134
->method('getSqlVersion')
135135
->willReturn($dbVersion);
136136
$this->adapter->expects($this->exactly($numberOfQueries))
@@ -145,7 +145,8 @@ public function testCompileWithColumnModificationAndFK(string $dbVersion, int $n
145145
public static function compileDataProvider() : array
146146
{
147147
return [
148-
[SqlVersionProvider::MARIA_DB_10_VERSION, 2],
148+
[SqlVersionProvider::MARIA_DB_10_4_VERSION, 2],
149+
[SqlVersionProvider::MARIA_DB_10_6_VERSION, 2],
149150
[SqlVersionProvider::MYSQL_8_0_VERSION, 1],
150151
];
151152
}

0 commit comments

Comments
 (0)