Fix Mysql and Postgresql bug

This commit is contained in:
Frédéric Guillot
2014-09-10 16:51:44 +02:00
parent 28ff8dad91
commit cede5d5434
8 changed files with 17 additions and 58 deletions

View File

@@ -36,20 +36,15 @@ class Schema
$function_name = '\Schema\version_'.$i;
if (function_exists($function_name)) {
call_user_func($function_name, $this->db->getConnection());
$this->db->getConnection()->setSchemaVersion($i);
}
else {
throw new \LogicException('To execute a database migration, you need to create this function: "'.$function_name.'".');
}
}
$this->db->closeTransaction();
}
catch (\PDOException $e) {
$this->db->setLogMessage($function_name.' => '.$e->getMessage());
$this->db->cancelTransaction();
return false;
}