Added migration options for --force and --fake.

This commit is contained in:
Marc J. Schmidt 2014-12-19 16:47:25 +01:00
parent 8f2ac4c3fa
commit c5062ec439
3 changed files with 12 additions and 0 deletions

View file

@ -34,6 +34,8 @@ class MigrationDownCommand extends WrappedCommand
->addOption('connection', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Connection to use. Example: default, bookstore')
->addOption('migration-table', null, InputOption::VALUE_OPTIONAL, 'Migration table name (if none given, the configured table is used)', null)
->addOption('output-dir', null, InputOption::VALUE_OPTIONAL, 'The output directory')
->addOption('fake', null, InputOption::VALUE_NONE, 'Does not touch the actual schema, but marks previous migration as executed.')
->addOption('force', null, InputOption::VALUE_NONE, 'Continues with the migration even when errors occur.')
;
}
@ -56,6 +58,8 @@ class MigrationDownCommand extends WrappedCommand
'--connection' => $this->getConnections($input->getOption('connection')),
'--migration-table' => $input->getOption('migration-table') ?: $this->getMigrationsTable(),
'--output-dir' => $input->getOption('output-dir') ?: $defaultOutputDir,
'--fake' => $input->getOption('fake'),
'--force' => $input->getOption('force'),
);
}
}

View file

@ -34,6 +34,8 @@ class MigrationMigrateCommand extends WrappedCommand
->addOption('connection', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Connection to use. Example: default, bookstore')
->addOption('migration-table', null, InputOption::VALUE_OPTIONAL, 'Migration table name (if none given, the configured table is used)', null)
->addOption('output-dir', null, InputOption::VALUE_OPTIONAL, 'The output directory')
->addOption('fake', null, InputOption::VALUE_NONE, 'Does not touch the actual schema, but marks all migration as executed.')
->addOption('force', null, InputOption::VALUE_NONE, 'Continues with the migration even when errors occur.')
;
}
@ -56,6 +58,8 @@ class MigrationMigrateCommand extends WrappedCommand
'--connection' => $this->getConnections($input->getOption('connection')),
'--migration-table' => $input->getOption('migration-table') ?: $this->getMigrationsTable(),
'--output-dir' => $input->getOption('output-dir') ?: $defaultOutputDir,
'--fake' => $input->getOption('fake'),
'--force' => $input->getOption('force'),
);
}
}

View file

@ -34,6 +34,8 @@ class MigrationUpCommand extends WrappedCommand
->addOption('connection', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Connection to use. Example: default, bookstore')
->addOption('migration-table', null, InputOption::VALUE_OPTIONAL, 'Migration table name (if none given, the configured table is used)', null)
->addOption('output-dir', null, InputOption::VALUE_OPTIONAL, 'The output directory')
->addOption('fake', null, InputOption::VALUE_NONE, 'Does not touch the actual schema, but marks next migration as executed.')
->addOption('force', null, InputOption::VALUE_NONE, 'Continues with the migration even when errors occur.')
;
}
@ -56,6 +58,8 @@ class MigrationUpCommand extends WrappedCommand
'--connection' => $this->getConnections($input->getOption('connection')),
'--migration-table' => $input->getOption('migration-table') ?: $this->getMigrationsTable(),
'--output-dir' => $input->getOption('output-dir') ?: $defaultOutputDir,
'--fake' => $input->getOption('fake'),
'--force' => $input->getOption('force'),
);
}
}