migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Custom Migration Template (create.php.template) Path/Name?

Open broberts-dev opened this issue 5 years ago • 2 comments

After reviewing the CakePHP migration plugin source, it appears, unlike when using Phinx directly, it's not possible without modifying the migrations plug-in source, which defeats the purpose of using Composer, to specify a custom migration template file (i.e. create.php.template) path/name.

The template path appears effectively hard-coded in ConfigurationTrait.php (cakephp\migrations\src\ConfigurationTrait.php).

Am I missing something or is there a means of doing this through app configuration?

broberts-dev avatar Dec 19 '19 20:12 broberts-dev

You mean

$templatePath = __DIR__ . DS . 'Template' . DS;

? I agree that having a templatePath() wrapper that also allows a configured alternative would make sense. Do you want to make a PR here?

dereuromark avatar Dec 19 '19 20:12 dereuromark

Yes, I'll work on a PR.

broberts-dev avatar Dec 19 '19 20:12 broberts-dev