2
When I used Python’s Django, I was surprised by the command inspectdb
, that is able to generate models based on an existing database.
At Laravel, we have Migrations to work with the database, and I find a very clean and organized way to keep changes to a project’s database.
However, in Laravel, by default, Migrations are always created manually, and usually the tutorials I see always indicate that they should be used from the beginning of the project development.
I did, however, have a new need: I have a database dump and would like to turn it into Laravel Migrations.
Is there a library in Laravel that allows reverse engineering of a database, transforming it into Laravel’s own Migrations?
That is, I want a library to read the existing database and manage the Migrations based on that structure.
I would like an answer to that, if possible, for Laravel 4 and 5 (as I use the 4 still).
Observing: I wouldn’t like solutions like importing DUMP to Migration and running it. It’s not ideal for the case I need.
I used one that reads relationships.
– Wallace Maxters
I did a thorough search for what I realized it generated the relationships only in a separate file. Anyway, this library is a good option. Which one did you use ?
– Vinicius Lourenço
Ah, interesting. I had used a
barryvdh/migration-generator
, but I realized thatxethron/migrations-generator
answered.– Wallace Maxters