简体   繁体   English

laravel 5中不存在“ --no-migration”选项

[英]The “--no-migration” option does not exist in laravel 5

I have installed laravel 5 and looking for scaffolding but when i run this command 我已经安装了laravel 5并正在寻找脚手架,但是当我运行此命令时

php artisan make:scaffold Tweet --schema="title:string:default('Tweet #1'), body:text"

it is giving exception "The "--no-migration" option does not exist". 它给出了异常““ --no-migration”选项不存在“。 I have checked it with php artisan migrate --help command and the option does not exists. 我已经使用php artisan migrate --help命令进行了检查,该选项不存在。 Can anybody help me please? 有人可以帮我吗?

Thanks. 谢谢。

The laralib/l5scaffold extension does not have a --no-migration option. laralib / l5scaffold扩展名没有--no-migration选项。 So you cannot prevent creating the migration files via command. 因此,您不能阻止通过命令创建迁移文件。

Currently I don't see any suitable way to achieve the desired behaviour. 目前,我没有找到实现所需行为的任​​何合适方法。 Just delete the migration files afterwards. 之后只需删除迁移文件即可。


Or implement the feature yourself and create a pull request to the repository . 或自己实现功能并创建对存储库的拉取请求。 You will probably only need to change src/Commands/ScaffoldMakeCommand.php . 您可能只需要更改src/Commands/ScaffoldMakeCommand.php Here are some hints: 这里有一些提示:

public function fire()
{
    // ...

    // Generate files
    if (!$this->option('no-migration')) {
        $this->makeMigration();
    }
    $this->makeSeed();
    // ...
}

protected function getOptions()
{
    return [
        ['schema', 's', InputOption::VALUE_REQUIRED, 'Schema ...', null],
        ['form', 'f', InputOption::VALUE_OPTIONAL, 'Use ...'],
        ['no-migration', 'm', InputOption::VALUE_OPTIONAL, 'Don\'t create migration files.']
    ];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM