Version20180522132838.php 891 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Application\Migrations;
  3. use MigrationsBundle\Migrations\MigrationsBase;
  4. use Doctrine\DBAL\Schema\Schema;
  5. /**
  6. * Migration para cargar los archivos .yml del directorio app/DoctrineMigrations/src
  7. */
  8. class Version20180522132838 extends MigrationsBase
  9. {
  10. /**
  11. * @param Schema $schema
  12. */
  13. public function up(Schema $schema)
  14. {
  15. // cargo todos los archivos que esten en src/
  16. // deben tener extensión yml
  17. $directory = __DIR__ . DIRECTORY_SEPARATOR . 'src';
  18. $migrations = scandir($directory);
  19. foreach ($migrations as $migration) {
  20. $this->executeYaml($directory, $migration);
  21. $this->showResult();
  22. }
  23. }
  24. /**
  25. * @param Schema $schema
  26. */
  27. public function down(Schema $schema)
  28. {
  29. // this down() migration is auto-generated, please modify it to your needs
  30. }
  31. }