Skip to content

Commit 551e937

Browse files
author
Sergii Kovalenko
committed
MAGETWO-89402: Make 'db:status' command works properly
--fix static tests
1 parent 361f270 commit 551e937

File tree

1 file changed

+5
-0
lines changed
  • lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints

1 file changed

+5
-0
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints/ForeignKey.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Framework\Setup\Declaration\Schema\Db\MySQL\Definition\Constraints;
88

99
use Magento\Framework\App\ResourceConnection;
10+
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Framework\Setup\Declaration\Schema\Db\DbDefinitionProcessorInterface;
1112
use Magento\Framework\Setup\Declaration\Schema\Dto\Constraints\Reference;
1213
use Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface;
@@ -72,6 +73,10 @@ public function toDefinition(ElementInterface $foreignKey)
7273
*/
7374
public function fromDefinition(array $data)
7475
{
76+
if (!isset($data['Create Table'])) {
77+
throw new LocalizedException(__('Can`t read foreign keys from current database'));
78+
}
79+
7580
$createMySQL = $data['Create Table'];
7681
$ddl = [];
7782
$regExp = '#,\s*CONSTRAINT\s*`([^`]*)`\s*FOREIGN KEY\s*?\(`([^`]*)`\)\s*'

0 commit comments

Comments
 (0)