Executing db migrations programmatically

I’ve no console access (SSH) to my production server, it’s a dumb shared host. Yes, I’d kill my customer, but it’s as is.

I need, obviously, to run migrations, but … is it possible, inside a controller action, create a Migration object and no the normally done operations of creating tables, etc… ?

I’ll try to instantiate actionMigrate()'s MigrateController in yiisoft\yii2\console\Controllers And BaseMigrateController.

Maybe it would be more useful to have migration as component.

… uhm …

I’m watching yii\db\Migration




class Migration extends Component implements MigrationInterface



I’ll try to extende Migration and then use it as a component in a custom controller action.

So I’ll can migrate db from a web page.

…well… why must I extend it? It works …

only one question: how can I declare ‘migration’ as a component of my app?

Then I would try to use ‘migration’ as component of your app.