Open AbanoubNassem opened 7 years ago
This is on our radar for a future release. Building a migration is certainly not a small/simple task. We're open for pull requests!
I did something like this in my current project. I may be able to create a pull request for this in the next days.
PR open :crossed_fingers: https://github.com/the-control-group/voyager/pull/2014
@fletch3555 can this issue be closed? @jeffochoa created a hook for this jeffochoa/voyager-bread-generator. Or do still want to add this to the core?
Might be useful to re-read this pr: #2014
That hook isn't the same as this. This issue is for automatically creating a migration class that matches the table that was created. That hook creates BREAD programmatically, but the table already exists. The --migration
flag just calls artisan make:migration
, which only creates a stub file.
So when I create a table with Voyager, a migration file should be created with the corresponding columns. But how are we going to handle changes to the table that have been made after the initial create_xxx_table
migration?
~I think a simple Dump Migration
button or php artisan voyager:table:dump
.. would be the easiest way. The developer can do with it what he wants. Like: comparing it with an old migration and copy paste the needed fields to create a migration that updates the table on the server.~
I just found out that the button already exists for this feature, so I will try to do an attempt in the next weeks/months.
Feature request : creating a table , generate/create migration for it .
it's useful when you are developing offline , then moving to production , so simply, running migration on the host will create the whole database tables needed.