Skip to content

Commit 582f503

Browse files
authored
Merge pull request #200 from PapsOu/master
Ability to change the class template
2 parents 0f62c9c + 1145946 commit 582f503

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Command/DoctrineCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public static function configureMigrations(ContainerInterface $container, Config
6767
$configuration->registerMigrationsFromDirectory($configuration->getMigrationsDirectory());
6868
}
6969

70+
if (!$configuration->getCustomTemplate()) {
71+
$configuration->setCustomTemplate($container->getParameter('doctrine_migrations.custom_template'));
72+
}
73+
7074
$organizeMigrations = $container->getParameter('doctrine_migrations.organize_migrations');
7175
switch ($organizeMigrations) {
7276
case Configuration::VERSIONS_ORGANIZATION_BY_YEAR:

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function getConfigTreeBuilder()
4242
->scalarNode('namespace')->defaultValue('Application\Migrations')->cannotBeEmpty()->end()
4343
->scalarNode('table_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()
4444
->scalarNode('name')->defaultValue('Application Migrations')->end()
45+
->scalarNode('custom_template')->defaultValue(null)->end()
4546
->scalarNode('organize_migrations')->defaultValue(false)
4647
->info('Organize migrations mode. Possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false')
4748
->validate()

0 commit comments

Comments
 (0)