GithubHelp home page GithubHelp logo

Comments (5)

Tigrov avatar Tigrov commented on August 16, 2024 1

Ok, try it

return [
    ...
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrationController',
        ],
    ],
    ...
];

Do not put it inside 'components' => []

from yii2-pgsql-audit.

longthanhtran avatar longthanhtran commented on August 16, 2024

It is my bad with above array ( .. ) section inside extensions.php, now when I visit Boostrap.php of yii2-pgsql-audit, it fall to map the migration to app scope, I think. So for now I still don't understand how the map can be made to external migrations folder / scope.

Edit. the error log likes this

Exception 'yii\base\InvalidConfigException' with message 'Object configuration must be an array containing a "class" element.'

from yii2-pgsql-audit.

Tigrov avatar Tigrov commented on August 16, 2024

Hi. Try to setup MigrateController in console/config/main.php:

return [
    ...
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController'
            'migrationPath' => '@console/migrations',
        ],
    ],
    ...
];

from yii2-pgsql-audit.

longthanhtran avatar longthanhtran commented on August 16, 2024

Hi Tigrov,

Thanks for your reply, and I can't find the console/config/main.php but config/console.php. Therefore I try with

return [
    'bootstrap' => [
        // The component registers own console commands
    ],
    'components' => [
        'controllerMap' => [
            'migrate' => [
                'class' => 'yii\console\controllers\MigrationController',
                'migrationPath' => '@console/migrations',
            ],
        ],
    ]
];

and still have the same error log when running migration

from yii2-pgsql-audit.

longthanhtran avatar longthanhtran commented on August 16, 2024

yeah, that's I also realize just right after I post the comment, the 'controllerMap'should stay on top level as your instruction. I also made the typo with MigrateController :D

return [
...
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
        ],
    ],
];

and it works perfectly. Might be the README update should help other users. Again, thank you very much 👍

from yii2-pgsql-audit.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.