migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Unable to bake migrations migration_snapshot in the plugin using another connection

Open salines opened this issue 5 years ago • 0 comments

This is a (multiple allowed):

  • [x] bug

  • [ ] enhancement

  • [ ] feature-discussion (RFC)

  • CakePHP Version: 4.0.9.

  • Migrations plugin version: ^3.0.

  • Bake plugin version (if relevant): ^2.0.3.

  • Database server (MySQL, SQLite, Postgres): MariaDB 10.4

  • PHP Version: 7.3

  • Platform / OS: Debian (VagrantBox debian/contrib-stretch64)

I try to bake migrations migration_snapshot in the plugin using another connection

  • Have two db on same server and setup in app.php (default, forum)

  • I can bake migrations snapshot or diff for both connection in main migrations folder, example bin/cake bake migration_snapshot Forum --connection forum

  • But if I try to bake migrations snapshot or diff in plugin (backed forum plugin) with 'forum' connection, then bake create migrations file with empty up and down methods

bin/cake bake migration_snapshot Forum --plugin Forum --connection forum

<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class Forum extends AbstractMigration
{
    /**
     * Up Method.
     * ...
     */
    public function up()
    {
    }

    /**
     * Down Method.
     * ...
    */
    public function down()
    {
    }
}

salines avatar Jul 02 '20 13:07 salines