Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to migrate voyager stuff to new deploy instance?

laravel voyager is cool, but how to migrate these tables\setting\breads from development to product instance? especially for those develop once, deploy multiple time, how could it be done gracefully?

as for laravel, the native database migration/seeder is good for this purpose

like image 331
Weimin Wang Avatar asked Mar 08 '23 05:03

Weimin Wang


2 Answers

I recommend using 3rd party tools to generate both migrations and seeds from your existing database tables.

Generate migrations: https://github.com/Xethron/migrations-generator

Generate seeds: https://github.com/orangehill/iseed

Files like DataRowsTableSeeder.php have already been created by Voyager - Iseed will want to overwrite them. If this is not acceptable to you, I have created a fork+pull request which allows you to explicitly specify the file/class name when running Iseed: https://github.com/mattrabe/iseed

like image 58
Matt Rabe Avatar answered Mar 10 '23 19:03

Matt Rabe


For Migration, just create migration and run migrate command.

For BREAD, use this package which will listen to the Voyager BREAD (ADD, Update, Delete) Events and will generate the respective seeder file.

like image 45
Drudge Rajen Avatar answered Mar 10 '23 17:03

Drudge Rajen