如何从现有数据库创建迁移?

编程入门 行业动态 更新时间:2024-10-24 06:26:16
本文介绍了如何从现有数据库创建迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何从现有数据库创建迁移? 我想用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

更多推荐

如何从现有数据库创建迁移?

本文发布于:2023-07-29 11:02:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1240104.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!