如何设置Phinx迁移以使用向上/向下方法创建迁移类


How to set Phinx migrations to create migration class with up/down method

你能告诉我是否可以将Phinx迁移设置为使用向上/向下方法创建迁移类,而不是更改默认选项吗?谢谢

创建自己的迁移模板:

<?php
use $useClassName;
class $className extends $baseClassName
{
    public function up() {
    }
    public function down() {
    }
}

然后在配置中应用它:

paths:
    migrations:
        - application/module1/migrations
templates:
    file: <your-custom-tmplate.path>