diff --git a/src/Schema.php b/src/Schema.php index 931b2f46..1ddfab06 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -748,7 +748,7 @@ protected function getCacheTag(): string */ private function findTableComment(TableSchemaInterface $tableSchema): void { - $sql = $tableSchema->getCreateSql(); + $sql = $tableSchema->getCreateSql() ?? ''; if (preg_match('#^[^(]+?((?:\s*--[^\n]*|\s*/\*.*?\*/)+)\s*\(#', $sql, $matches) === 1) { $comment = $this->filterComment($matches[1]); @@ -763,7 +763,7 @@ private function findTableComment(TableSchemaInterface $tableSchema): void */ private function findComments(TableSchemaInterface $tableSchema): void { - $sql = $tableSchema->getCreateSql(); + $sql = $tableSchema->getCreateSql() ?? ''; if (!preg_match('#^(?:[^(]*--[^\n]*|[^(]*/\*.*?\*/)*[^(]*\((.*)\)[^)]*$#s', $sql, $matches)) { return;