thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

FEATURE creating table creates a migration for it? #1921

Open AbanoubNassem opened 7 years ago

AbanoubNassem commented 7 years ago

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.

fletch3555 commented 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!

jeffochoa commented 7 years ago

I did something like this in my current project. I may be able to create a pull request for this in the next days.

jeffochoa commented 7 years ago

PR open :crossed_fingers: https://github.com/the-control-group/voyager/pull/2014

cyrildewit commented 6 years ago

@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

fletch3555 commented 6 years ago

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.

cyrildewit commented 6 years ago

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.~

cyrildewit commented 6 years ago

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.