src/DumpController.php
public function actionGenerate()
    {
        $this->output->startPrintf('Process');
        $tableOptions = $this->getOptions($this->table);
        $filterOptions = $this->getOptions($this->filter);
        $info = Yii::t('dump', 'Generate Migration File');

        foreach ($this->db->getSchema()->getTableSchemas() as $table) {
            // filter some table  -filter=...  -table=...
            if ($this->filterTable($table->name, $filterOptions, $tableOptions)) {
                continue;
            }

            switch ($this->type) {
                case '0':
                    $this->generateFile($table, 'table', $info, 2);
                    break;

                case '1':
                    $this->generateFile($table, 'tableData', $info, 2);
                    break;

                case '2':
                    $this->generateFile($table, 'key', $info, 2);
                    break;

                case '3':
                    $this->generateFile($table, 'FK', $info, 2);
                    break;

                default:
                    $this->generateFile($table, 'table', $info, 2);
                    $this->generateFile($table, 'tableData', $info, 2);
                    $this->generateFile($table, 'key', $info, 2);
                    $this->generateFile($table, 'FK', $info, 2);
                    break;
            }

        }

        $this->output->conclusion($this->generations, $this->filters);
        $this->output->endPrintf('Process');
        return 0;
    }
public function actionGenerate()
    {
        $this->output->startPrintf('Process');
        $tableOptions = $this->getOptions($this->table);
        $filterOptions = $this->getOptions($this->filter);
        $info = Yii::t('dump', 'Generate Migration File');

        foreach ($this->db->getSchema()->getTableSchemas() as $table) {
            // filter some table  -filter=...  -table=...
            if ($this->filterTable($table->name, $filterOptions, $tableOptions)) {
                continue;
            }

            switch ($this->type) {
                case '0':
                    $this->generateFile($table, 'table', $info, 2);
                    break;

                case '1':
                    $this->generateFile($table, 'tableData', $info, 2);
                    break;

                case '2':
                    $this->generateFile($table, 'key', $info, 2);
                    break;

                case '3':
                    $this->generateFile($table, 'FK', $info, 2);
                    break;

                default:
                    $this->generateFile($table, 'table', $info, 2);
                    $this->generateFile($table, 'tableData', $info, 2);
                    $this->generateFile($table, 'key', $info, 2);
                    $this->generateFile($table, 'FK', $info, 2);
                    break;
            }

        }

        $this->output->conclusion($this->generations, $this->filters);
        $this->output->endPrintf('Process');
        return 0;
    }
generate migration file -type = 0 generate table, 1 generate table data, 2 generate add key, 3 generate add foreign key
@return int the status of the action execution