Migrator: MySQL to Laravel Migration Generator
, (*1)
Install Via Composer
composer require awkwardideas/migrator, (*2)
Add to Laravel App Config
/*
* Package Service Providers...
*/
AwkwardIdeas\Migrator\MigratorServiceProvider::class,
Commands via Artisan
Command line actions are done via artisan. The host, username, password from the .env file are used for making the connection., (*3)
php artisan migrator:clean
Removes all migrations files from the migrations folder, (*4)
php artisan migrator:truncate
Truncates the provided database., (*5)
--database= Database to truncate
--force Bypass confirmations, (*6)
php artisan migrator:purge
Combination of Clean and Truncate, (*7)
Options:, (*8)
--database= Database to truncate
--force Bypass confirmations, (*9)
php artisan migrator:prepare
Create migration files using the database information in .env, (*10)
Options:, (*11)
--from= Database to migrate from
--force Bypass confirmations, (*12)
php artisan migrator:migrate
Create migration files using the database information in .env and run php artisan migrate, (*13)
Options:, (*14)
--from= Database to migrate from
--to= Database to migrate to (for truncation)
--force Bypass confirmations, (*15)