Laravel Custom DB Migrate allows fine grain control of migrations inside your Laravel or Lumen application. You can choose which migration files - or groups of files inside the directory - get migrated to the database.
You can install the package via composer:
composer require sayeed/custom-migrate
The package will automatically register itself, so you can start using it immediately.
In Laravel version 5.4 and older, you have to add the service provider in config/app.php
file manually:
'providers' => [
// ...
Sayeed\CustomMigrate\CustomMigrateServiceProvider::class,
];
After installing the package, you will have to register it in bootstrap/app.php
file manually:
// Register Service Providers
// ...
$app->register(Sayeed\CustomMigrate\CustomMigrateServiceProvider::class);
];
After installing the package, you will now see a new php artisan migrate:custom
command.
You can migrate a specific file inside your database/migrations
folder using:
php artisan migrate:custom -f 2018_10_14_054732_create_tests_table
Alternatively, you can use the longform version:
php artisan migrate:custom --file 2018_10_14_054732_create_tests_table
You can migrate a specific directory inside your database/migrations
folder using:
php artisan migrate:custom -d migrations-subfolder
Alternatively, you can use the longform version:
php artisan migrate:custom --directory migrations-subfolder
You can refresh migrations inside your project using:
php artisan migrate:custom -r
Alternatively, you can use the longform version:
php artisan migrate:custom --refresh
For any questions, you can reach out to the author of this package, Md. Hasan Sayeed.
Thank you for using it.