I’ve DB in phpmyadmin with many tables in it.
I want to auto generate those tables into seperate laravel migration files.
Does anyone know of such a possibility?
Question posted in PhpMyAdmin
The official documentation can be found here.
The official documentation can be found here.
2
Answers
This way your migrations table will be separated for each database.
Use the
--database
parameter with themigrate
command and store the migrations for each database in separate directories.You could have separate directories in
app/database/migrations
for each of your database (for example :db1
anddb2
) and store the appropriate migrations in each directory. Then you could run the migrations like this:If you want to go the extra mile and automate the process you could create your custom command that will run all the migrations at once. You can create the command like this:
You can check the Laravel Command Docs for more info.
You can install package for that https://github.com/Xethron/migrations-generator