Skip to content

Commit 0e90642

Browse files
committed
Update DatabaseChecker.php
1 parent ec1ff9d commit 0e90642

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Ubiquity/orm/reverse/DatabaseChecker.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ public function getNonExistingTables(): array {
5757
$existingTables = $this->db->getTablesName();
5858
}
5959
$tables = Reflexion::getAllJoinTables($this->models);
60-
foreach ($this->metadatas as $model => $metas) {
61-
$tablename = $metas['#tableName'];
62-
if (\array_search($tablename, $existingTables) === false && \array_search($tablename, $tables) === false) {
63-
$tables[$model] = $tablename;
60+
if (isset($this->metadatas)) {
61+
foreach ($this->metadatas as $model => $metas) {
62+
$tablename = $metas['#tableName'];
63+
if (\array_search($tablename, $existingTables) === false && \array_search($tablename, $tables) === false) {
64+
$tables[$model] = $tablename;
65+
}
6466
}
6567
}
6668
return \array_diff($tables, $existingTables);

0 commit comments

Comments
 (0)