PHP code example of zhezhong17 / yii2-migration

1. Go to this page and download the library: Download zhezhong17/yii2-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/ */

    

zhezhong17 / yii2-migration example snippets


'controllerMap' => [
    'migrate' => [
        'class' => 'zhezhong17\migration\ConsoleController',
    ]
],

php ./yii migrate/reverse all # 逆向生成全部表
php ./yii migrate/reverse table1 #备份一张表
php ./yii migrate/reverse table1,table2,table3... #备份多张表 

php ./yii migrate/up #恢复全部表