本文介绍了如何从现有数据库创建迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从现有数据库创建迁移? 我想用Xerton做到这一点.我尝试执行:
How can I create migration from existing database? I wanted to do this with Xerton. I try do execute:
php artisan make:migration但是我收到此错误:
Not enough arguments (missing: "name").是否可以一次迁移现有数据库?不必单独迁移表?
Is it possible to migrate the existing database at once? Without having to migrate the tables separately?
推荐答案创建迁移时,您必须像这样指定迁移的名称:
When you create a migration you have to specify the name of the migration like this :
php artisan make:migration create_users_table php artisan make:migration add_votes_to_users_table使用Xerton:
运行php artisan migration:generate为所有表创建迁移
Run php artisan migrate:generate to create migrations for all the table
更多推荐
如何从现有数据库创建迁移?
发布评论