123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Application\Migrations;
- use MigrationsBundle\Migrations\MigrationsBase;
- use Doctrine\DBAL\Schema\Schema;
- class Version20180809155041 extends MigrationsBase
- {
- /**
- * @param Schema $schema
- */
- public function up(Schema $schema)
- {
- // migrations a borrar
- $migrationVersions = [
- '20180124153518',
- '20180606123455',
- ];
- foreach ($migrationVersions as $version) {
- $this->addSql("DELETE FROM migration_versions WHERE version = {$version};");
- }
-
- foreach ($migrationVersions as $version) {
- $this->addSql("DELETE FROM migration_versions WHERE version = {$version};");
- }
- // cargo todos los archivos que esten en src/
- // deben tener extensión yml
- $directory = __DIR__ . DIRECTORY_SEPARATOR . 'src';
- $migrations = scandir($directory);
- foreach ($migrations as $migration) {
- $this->executeYaml($directory, $migration);
- $this->showResult();
- }
- }
- /**
- * @param Schema $schema
- */
- public function down(Schema $schema)
- {
- }
- }
|