如何从 laravel 中的现有数据库创建迁移

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

我是 laravel 的新手.我知道从 laravel 迁移创建数据库的命令.

I am new to laravel. i know command to create database from laravel migration.

我已经在 mysql 中创建了数据库.那么我怎样才能从该数据库转换迁移.

I have already created database in mysql. so how can i convert migration from that database.

推荐答案

你可以使用 Jeffrey Way 的 Laravel 4 生成器工具,手动完成.这是一个非常有用的工具.github/JeffreyWay/Laravel-4-Generators(如果你是使用 Laravel 5,请改用这个包:github/laracasts/Laravel-5-Generators-Extended)

You could use Jeffrey Way's generator tool for Laravel 4, and do them by hand. It is a very useful tool. github/JeffreyWay/Laravel-4-Generators (if you are using Laravel 5, use this package instead: github/laracasts/Laravel-5-Generators-Extended)

或者您可以尝试以下软件包之一,它们应该将您现有的架构转换为 Laravel 迁移.我没有尝试过,但看看:

Or you could try out one of the following packages, they should convert your existing schema to Laravel migrations. I have not tried them, but have a look:

  • github/adamkearsley/laravel-convert-migrations

github/barryvdh/laravel-migration-generator

另外,在另一个问题中阅读以下答案,可能对您或其他人有用:Laravel 中实体的逆向工程或自动生成?

Also, read the following answer in another question, might be useful to you or others: Reverse engineering or Auto-Generations of Entities in Laravel?

更多推荐

如何从 laravel 中的现有数据库创建迁移

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

发布评论

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

>www.elefans.com

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