迁移与模型之间有什么关系?

时间:2020-09-17 12:09:20

标签: laravel

我已经创建了一个模型php artisan make:model CommentOnPost,并且想要创建它的迁移文件,我应该使用什么迁移名称? 是php artisan make:migration create_comment_on_posts_table正确吗????

1 个答案:

答案 0 :(得分:0)

您也可以使用migration创建model文件。

php artisan make:model CommentOnPost -m->迁移,使用此命令创建模型文件

其他

php artisan make:migration create_comment_on_posts_table --create=comment_on_posts //仅创建迁移文件

php artisan make:model CommentOnPost -mcr //用于创建MigrationModelController文件