PHP code example of yii2framework / yiiframe-console-migration
1. Go to this page and download the library: Download yii2framework/yiiframe-console-migration library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yii2framework / yiiframe-console-migration example snippets
use yii\base\Object // PHP7.1 and previous versions
use yii\base\BaseObject // PHP7.2
'controllerMap' => [
'migrate' => [
'class' => 'yiiframe\migration\ConsoleController',
],
],
public function actions()
{
return [
'backup' => [
'class' => 'yiiframe\migration\WebAction',
'returnFormat' => 'json',
'migrationPath' => '@console/migrations'
]
];
}
$migrate = Yii::createObject([
'class' => 'yiiframe\migration\components\MigrateCreate',
'migrationPath' => $this->migrationPath
]);
$migrate->create($table);
/admin/public/backup?tables=yii2_ad,yii2_admin