Skip to content

Commit d6523aa

Browse files
committed
Added a better error message!
1 parent 9b8dc40 commit d6523aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Commands/AbstractCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ public function getDbDriver()
3131

3232
public function getVersion()
3333
{
34-
return $this->getDbDriver()->getScalar('SELECT version FROM migration_version');
34+
try {
35+
return $this->getDbDriver()->getScalar('SELECT version FROM migration_version');
36+
} catch (\Exception $ex) {
37+
throw new \Exception('This database does not have a migration version. Please use "migrate reset" to create one.');
38+
}
3539
}
3640

3741
public function setVersion($version)

0 commit comments

Comments
 (0)