Browse Source

Cambios menores

gabriel 8 years ago
parent
commit
154d35a5be
3 changed files with 14 additions and 11 deletions
  1. 12 2
      Migrations/MigrationsBase.php
  2. 1 1
      MigrationsBundle.php
  3. 1 8
      README.md

+ 12 - 2
Migrations/MigrationsBase.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Migrations;
+namespace MigrationsBundle;
 
 use Doctrine\DBAL\Migrations\AbstractMigration;
 use Doctrine\DBAL\Schema\Schema;
@@ -210,7 +210,17 @@ class MigrationsBase extends AbstractMigration implements ContainerAwareInterfac
 			// reemplazo los valores que poseen import
 			$value = $this->replaceImportsValue($dir, $value);
 
-			// creo los insert
+			// lo hago de esta forma para que se ejecuten de acuerdo a como se escribe el yaml.
+			//foreach ($value as $key => $val) {
+			//	$this->setLine(0);
+			//	if (strtoupper($key) === MigrationsBase::INSERT) {
+			//		$this->createInserts($value[MigrationsBase::INSERT]);
+			//	} else if (strtoupper($key) === MigrationsBase::UPDATE) {
+			//		$this->createUpdates($value[MigrationsBase::UPDATE]);
+			//	} else if (strtoupper($key) === MigrationsBase::DELETE) {
+			//		$this->createDeletes($value[MigrationsBase::DELETE]);
+			//	}
+			//}
 			if (array_key_exists(MigrationsBase::INSERT, $value)) {
 				$this->setLine(0);
 				$this->createInserts($value[MigrationsBase::INSERT]);

+ 1 - 1
MigrationsBundle.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Migrations;
+namespace MigrationsBundle;
 
 use Symfony\Component\HttpKernel\Bundle\Bundle;
 

+ 1 - 8
README.md

@@ -25,20 +25,13 @@
 public function registerBundles()
 {
     $bundles = [
-        new OwnerVoterBundle\OwnerVoterBundle()
+        new MigrationsBundle\MigrationsBundle()
     ];
     .
     .
 }
 ```
 
-**app/config/config.yml**:
-
-```yml
-imports:
-    - { resource: "@ExtraBundle/Resources/config/services.yml" }
-```
-
 ## Class
 
 - **Migrations\MigrationsBase**: Clase de la cual se debe extender para poder hacer migraciones interpretando un yaml.