[GH-ISSUE #43] Migration PHINX #168

Open
opened 2026-03-07 20:41:46 +03:00 by kerem · 4 comments
Owner

Originally created by @SoftSolid on GitHub (Mar 17, 2017).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/43

Hello
Perhaps to add automatic generation of file migration PHINX?

Robert.

Originally created by @SoftSolid on GitHub (Mar 17, 2017). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/43 Hello Perhaps to add automatic generation of file migration PHINX? Robert.
Author
Owner

@jasdeepkhalsa commented on GitHub (Nov 24, 2017):

Hi Robert,

This should be really straight-forward.

In templates, add a new one called something like phinx.tmpl and add the following to that:

<?php

use Phinx\Migration\AbstractMigration;

class MyNewMigration extends AbstractMigration
{
    public function up() 
    {
        $this->execute("{{ up }}");
    }

    public function down() 
    {
        $this->execute("{{ down }}");
    }
}

You'll probably also have to specific this as a php file using the --output flag on the command-line: --output=./output-dir/migration.php

If this works, let me know and I'll add it to the core code-base for others to benefit from!

<!-- gh-comment-id:346868573 --> @jasdeepkhalsa commented on GitHub (Nov 24, 2017): Hi Robert, This should be really straight-forward. In templates, add a new one called something like `phinx.tmpl` and add the following to that: ``` <?php use Phinx\Migration\AbstractMigration; class MyNewMigration extends AbstractMigration { public function up() { $this->execute("{{ up }}"); } public function down() { $this->execute("{{ down }}"); } } ``` You'll probably also have to specific this as a php file using the `--output` flag on the command-line: `--output=./output-dir/migration.php` If this works, let me know and I'll add it to the core code-base for others to benefit from!
Author
Owner

@SoftSolid commented on GitHub (Nov 24, 2017):

Hello jhbsk
We dealt with the problem earlier. Thank you.Good job. We made some changes and used your program to create phinx migration for our jobs.
If we have time we will try to prepare a pull request to improve the tool.

Robert.

<!-- gh-comment-id:346874757 --> @SoftSolid commented on GitHub (Nov 24, 2017): Hello jhbsk We dealt with the problem earlier. Thank you.Good job. We made some changes and used your program to create phinx migration for our jobs. If we have time we will try to prepare a pull request to improve the tool. Robert.
Author
Owner

@jasdeepkhalsa commented on GitHub (Nov 24, 2017):

@SoftSolid That's great to hear! If you have any examples of the templates and commands you used feel free to post here!

<!-- gh-comment-id:346875185 --> @jasdeepkhalsa commented on GitHub (Nov 24, 2017): @SoftSolid That's great to hear! If you have any examples of the templates and commands you used feel free to post here!
Author
Owner

@jasdeepkhalsa commented on GitHub (Nov 24, 2017):

Yep a PR would be great too!

<!-- gh-comment-id:346875232 --> @jasdeepkhalsa commented on GitHub (Nov 24, 2017): Yep a PR would be great too!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#168
No description provided.