Answer the question
In order to leave comments, you need to log in
Is it possible to run a migration without a console in YII2?
I wanted to make a module installer in the backend and came across a problem with adding tables to the database. It would be convenient to upload a migration file and run it. But how to do this not from the console, but from the backend of the site? Is it possible to make a request from the backend controller to the console controller? And will it be possible to run the migration?
Answer the question
In order to leave comments, you need to log in
If by "module in the backend" you mean an analogue of plugins in Wordpress, then install for each module through some install () method, in which you create the necessary tables, add / delete data from them, etc.
modules will be added to hundreds of working landingpages, while each of them may have its own characteristics, but the module as an independent unit can be added or removed at any time, which means that migrations and their rollbacks are needed. I made a landing - hung it on hosting, gave the keys to the customer. And he can buy a module from the admin panel over time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question