【发布时间】:2021-01-07 12:57:15
【问题描述】:
什么是函数(在进行迁移时,例如
php artisan make:migration create_users_table --create=users??
如果我不使用它会怎样?
【问题讨论】:
-
“功能”是什么意思?
-
laravel.com/docs/master/migrations#generating-migrations
The --table and --create options may also be used to indicate the name of the table and whether or not the migration will be creating a new table. These options pre-fill the generated migration stub file with the specified table -
make命令用于创建文件和添加代码模板进行开发。您可以跳过此步骤并手动创建文件。php artisan make:migration create_users_table --create=users此命令将在database/migrations目录中创建一个带有预填充代码模板的文件。这只是为了简化开发。 -
抱歉语法错误。问题应该是:进行迁移时创建的功能是什么,例如在 php artisan make:migration create_users_table --create=users?如果我不使用它会怎样?
-
我可以在没有 --create 命令的情况下编写 php artisan make:migration create_users_table 吗?