diff --git a/src/Command/ModelCommand.php b/src/Command/ModelCommand.php index 8ef1b3bc..1fb504d4 100644 --- a/src/Command/ModelCommand.php +++ b/src/Command/ModelCommand.php @@ -424,7 +424,7 @@ public function findTableReferencedBy(TableSchemaInterface $schema, string $keyF foreach ($schema->constraints() as $constraint) { $constraintInfo = $schema->getConstraint($constraint); - if (!in_array($keyField, $constraintInfo['columns'])) { + if (!in_array($keyField, $constraintInfo['columns'] ?? [])) { continue; } @@ -933,7 +933,7 @@ public function fieldValidation( foreach ($schema->constraints() as $constraint) { $constraint = $schema->getConstraint($constraint); - if (!in_array($fieldName, $constraint['columns'], true) || count($constraint['columns']) > 1) { + if (!in_array($fieldName, $constraint['columns'] ?? [], true) || count($constraint['columns']) > 1) { continue; }