Yii2.0 数据迁移
in PHP with 0 comment, Views is 27

Yii2.0 数据迁移

in PHP with 0 comment, Views is 27

安装migration

$ composer require e282486518/yii2-console-migration "@dev"
# 或者 在composer.json里添加 "e282486518/yii2-console-migration": "*" 
# 并 composer update

在 consoleconfigmain.php 里

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

在命令行

php ./yii migrate/backup all                     # 备份全部表
php ./yii migrate/backup table1,table2,table3... # 备份多张表
php ./yii migrate/backup table1                  # 备份一张表
php ./yii migrate/up                             # 恢复全部表

GITHUB地址

Responses
选择表情