yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.9k forks source link

Refactoring for Migration Controllers #17590

Open grandmotivator opened 5 years ago

grandmotivator commented 5 years ago

\yii\console\controllers\BaseMigrateController::getNewMigrations \yii\console\controllers\MigrateController::getMigrationHistory

It would be more correct to transfer business logic from controllers to models.

samdark commented 5 years ago

What problem do you want to solve with such refactoring?

grandmotivator commented 5 years ago

Using the code of these two methods in custom project.

samdark commented 5 years ago

OK. That is significant issue that could be considered as solvable architectural bug.

samdark commented 5 years ago

Do you want to try fixing it?

grandmotivator commented 5 years ago

Until then, developers have to use not very effective methods to get this functionality.

Example: https://github.com/tourhunter-com/yii2-dev-updater/blob/master/src/MigrationHelper.php