Can you tell me please if is possible to set Phinx migrations to create migration class with up/down method instead of change which is default option? Thanks.
Asked
Active
Viewed 934 times
0
-
1You can create your own [migration template](http://docs.phinx.org/en/latest/commands.html#the-create-command) and provide it from command line, but I don't know if there is any `sh phinx create Migration --up-down` thing. – Kamil Latosinski May 10 '16 at 06:12
-
Yes I have it. But it is not exactly what I want. Thanks. – Čamo May 10 '16 at 08:08
-
If somebody don't know, template you can set class name via $className in template file. Also save template as txt file to alove this. – Čamo May 15 '16 at 15:03
1 Answers
1
Create your own migration template:
<?php
use $useClassName;
class $className extends $baseClassName
{
public function up() {
}
public function down() {
}
}
And then apply it in the config:
paths:
migrations:
- application/module1/migrations
templates:
file: <your-custom-tmplate.path>

t1gor
- 1,244
- 12
- 25