File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 7
7
namespace Magento \Framework \Setup \Declaration \Schema \Db \MySQL \Definition \Constraints ;
8
8
9
9
use Magento \Framework \App \ResourceConnection ;
10
+ use Magento \Framework \Exception \LocalizedException ;
10
11
use Magento \Framework \Setup \Declaration \Schema \Db \DbDefinitionProcessorInterface ;
11
12
use Magento \Framework \Setup \Declaration \Schema \Dto \Constraints \Reference ;
12
13
use Magento \Framework \Setup \Declaration \Schema \Dto \ElementInterface ;
@@ -72,6 +73,10 @@ public function toDefinition(ElementInterface $foreignKey)
72
73
*/
73
74
public function fromDefinition (array $ data )
74
75
{
76
+ if (!isset ($ data ['Create Table ' ])) {
77
+ throw new LocalizedException (__ ('Can`t read foreign keys from current database ' ));
78
+ }
79
+
75
80
$ createMySQL = $ data ['Create Table ' ];
76
81
$ ddl = [];
77
82
$ regExp = '#,\s*CONSTRAINT\s*`([^`]*)`\s*FOREIGN KEY\s*?\(`([^`]*)`\)\s* '
You can’t perform that action at this time.
0 commit comments