Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations.
Is there a way on how to migrate a certain migration file (1 migration only),
php artisan help migrate
You will see the option:
--path[=PATH] The path to the migrations files to be executed
By the way, you can probably indicate the root folder of the file that you want to migrate:
php artisan migrate --path=/database/migrations/sample.php
Or, You can create a new folder in migrations, then migrate all the migration files you want inside it:
php artisan migrate --path=/database/migrations/new_folder
You could try to use the --path= option to define the specific sub-folder you're wanting to execute and place specific migrations in there.
Alternatively you would need to remove reference and tables from the DB and migrations tables which isn't ideal :/
install this package
https://github.com/nilpahar/custom-migration/
and run this command.
php artisan migrate:custom -f migration_name
you should add the path to your migration file to refresh just this table and run
php artisan migrate:refresh --path=/database/migrations/fileName.php
You can only run this command in your terminal
php artisan migrate --path=database/migrations/2020_10_01_164611_create_asset_info_table.php
After migrations you should put the particular file name. or if you have any folder inside migration then just add that folder name after the migration.
Like this
php artisan migrate --path=database/migrations/yourfolder/2020_10_01_164611_create_asset_info_table.php
I hope this will help you a lil bit. Happy Coding.
You need to put the file(s) into a new directory (ex:selected) and then apply
php artisan migrate --path=/database/migrations/selected
if you need rollback:
php artisan migrate:rollback --path=/database/migrations/selected
Note:
php artisan migrate:refresh
this will rollback and then migrate all the migrations files in the default directory (/database/migrations)