public function generateFile(TableSchema $table, $functionName, $tip = null, $indent = 0)
    {
        $params = $this->getParams($table, $functionName, $indent);

        if (
            empty($params['safeUp'])   ||
            empty($params['safeDown']) ||
            empty($params['className'])
        ) {
            return false;
        }

        $template = Yii::getAlias($this->templateFile);
        $outputFile = Yii::getAlias($this->generateFilePath) . DIRECTORY_SEPARATOR . $params['className'] . '.php';

        if (! empty($tip)) {
            $this->output->startPrintf($tip); // record start time
            $this->output->stdout($outputFile . "\n");
            $rst = $this->output->generateFile($params, $template, $outputFile);
            $this->output->endPrintf($tip); // record end time
        } else {
            $this->output->stdout($outputFile);
            $rst = $this->output->generateFile($params, $template, $outputFile);
        }

        return $rst;
    }