|
@@ -455,21 +455,32 @@ class MigrationsBase extends AbstractMigration implements ContainerAwareInterfac
|
|
|
*/
|
|
|
protected function executeYaml($dir, $file)
|
|
|
{
|
|
|
- $this->connection->beginTransaction();
|
|
|
try {
|
|
|
- $this->interpretYaml($dir, $file);
|
|
|
- if (count($this->getErrorLineExecution()) > 0
|
|
|
- ) {
|
|
|
- //se produjeron errores
|
|
|
- $this->connection->rollBack();
|
|
|
- echo "\nSe produjeron errores de sql.\n";
|
|
|
+ $tmp = explode("\\", get_class($this));
|
|
|
+ if ($tmp != null && count($tmp) > 0) {
|
|
|
+ $version = $tmp[count($tmp) - 1];
|
|
|
} else {
|
|
|
- $this->connection->commit();
|
|
|
- echo "\nMigracion correcta.\n";
|
|
|
+ $version = "";
|
|
|
+ }
|
|
|
+ echo "\n\tInicio del procesamiento de la migracion: " . $version;
|
|
|
+ $this->connection->beginTransaction();
|
|
|
+ try {
|
|
|
+ $this->interpretYaml($dir, $file);
|
|
|
+ if (count($this->getErrorLineExecution()) > 0
|
|
|
+ ) {
|
|
|
+ //se produjeron errores
|
|
|
+ $this->connection->rollBack();
|
|
|
+ echo "\n\t\tSe produjeron errores de sql.\n";
|
|
|
+ } else {
|
|
|
+ $this->connection->commit();
|
|
|
+ echo "\n\t\tMigracion correcta.\n";
|
|
|
+ }
|
|
|
+ } catch (\Throwable $ex) {
|
|
|
+ $this->connection->rollBack();
|
|
|
+ echo "\n\t\tSe produjeron errores por una excepcion. " . $ex->getMessage() . "\n";
|
|
|
}
|
|
|
} catch (\Throwable $e) {
|
|
|
- $this->connection->rollBack();
|
|
|
- echo "\nSe produjeron errores por una excepcion. " . $e->getMessage() . "\n";
|
|
|
+ echo "\n\t\tSe produjeron errores genericos. " . $e->getMessage() . "\n";
|
|
|
}
|
|
|
}
|
|
|
|