thedevdojo / voyager

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

[Feature] Generate migration file when database table created #204

Closed handiwijoyo closed 7 years ago

handiwijoyo commented 7 years ago

We need to generate migration file when database table created / edited via voyager.

It will be easier to pass the project to another developer and to run testing during development, since all database created will be wiped out when we are refreshing the database or run migrate:refresh command.

I will not using table creation feature at moment, and will manually create migration & model file then add bread to it.

marktopper commented 7 years ago

This would also be a good idea to have when modifying existing database tables.

akazorg commented 7 years ago

We should work on that indeed!!

brandonferens commented 7 years ago

+1

brandonferens commented 7 years ago

I'm actually not sure how I feel about this. There are so many potential caveats and directions this could go. One of the benefits of having this dynamic system is that you don't really need migrations. HOWEVER, it is a pain to move from a dev server to a live server. Perhaps we utilize a package like Migrations Generator to create the necessary migrations only when the user wants them created. They could check a box that creates the migration, or the could choose from a list of db tables to have migrations created from.

craigharman commented 7 years ago

What about also having a global setting "create migrations" that always created migrations when a new table was created or existing table updated?

handiwijoyo commented 7 years ago

I believe using https://github.com/Xethron/migrations-generator will the best solution for now.

fletch3555 commented 7 years ago

Using the Xethron migrations generator is a good workaround, but I agree that this would be a reasonable addition to Voyager. I'm open to further suggestions on how we can implement it (ideally without requiring an Artisan command to do so).

fletch3555 commented 7 years ago

I'm going to close this for now since it's so old. We may revisit this after the 1.0 release. In the meantime, if anyone wants to tackle it, we're certainly open to pull requests

belthaZornv commented 6 years ago

Bump - this is the only feature that is missing to support the db functionality; it's a tiny bit useless to be able to create db tables without having the migrations generated alongside it. - Is it possible to re-open this; and using xethron/or similar could be an hours work or so.

What do you guys think?

KABBOUCHI commented 6 years ago

@belthaZornv db migration is done, you can follow the progress here #2604

belthaZornv commented 6 years ago

Thanks buddy, wasn't aware. :)

psierak commented 5 years ago

I think this is an important feature to have. Without it, wouldn't it make most sense just to work with tables and edits to tables outside of voyager? Just use Voyager to have the admin panel/bread to have clients enter data/posts into the database. But do all development and coding outside of the voyager with php artisan commands.. right?

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.