Skip to content

Commit fb18420

Browse files
committed
Update RunMigrationsCommand.php
1 parent 5b3bcb1 commit fb18420

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

webfiori/framework/cli/commands/RunMigrationsCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ private function checkMigrationsTable(?MigrationsRunner $runner, $conn = null) {
7878
$conn = $this->getDBConnection($runner);
7979
}
8080
if ($conn !== null) {
81-
$temp = $runner !== null ? $runner : new MigrationsRunner(APP_PATH, '\\'.APP_DIR, $conn);
81+
8282
try {
8383
$this->println("Initializing migrations table...");
84+
$temp = $runner !== null ? $runner : new MigrationsRunner(APP_PATH, '\\'.APP_DIR, $conn);
85+
8486
$temp->createMigrationsTable();
8587
$this->success("Migrations table succesfully created.");
86-
} catch (Throwable $ex) {
87-
$this->error('Unable to create migrations table: '.$ex->getMessage());
88+
} catch (\Throwable $ex) {
89+
$this->error('Unable to create migrations table due to following:');
90+
$this->println($ex->getMessage());
8891
return -1;
8992
}
9093
return 0;

0 commit comments

Comments
 (0)