Answer the question
In order to leave comments, you need to log in
Running migration in console command?
I made my own entity generator, after generating files, 2 commands occur
/**
* @throws Exception
*/
private function migrateNewEntity() {
// Generate database migration fore new Entity
/** @var Application $application */
$application = $this->getApplication();
/** @var MigrationsDiffDoctrineCommand|Command $command */
$command = $application->find('doctrine:migrations:diff');
$arguments = [
'command' => 'doctrine:migrations:diff',
];
$greetInput = new ArrayInput($arguments);
$command->run($greetInput, new NullOutput());
// migrate new migration
/** @var MigrationsMigrateDoctrineCommand|Command $command */
$command = $application->find('doctrine:migrations:migrate');
$arguments = [
'command' => 'doctrine:migrations:migrate',
];
$greetInput = new ArrayInput($arguments);
$command->run($greetInput, new NullOutput());
}
In MappingException.php line 64:
No mapping file found named 'Testik.orm.xml' for class 'App\Entity\Testik'.
console doctrine:schema:validate
Mapping
-------
[OK] The mapping files are correct.
Database
--------
[ERROR] The database schema is not in sync with the current mapping file.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question