Search code examples
phplaraveldatabase-migration

How to migrate specific migration file in PHP laravel - Nothing to migrate message


I have a migration file that I want to run, (only this file not all the migrations file). enter image description here

I run this command:

php artisan migrate --path=/database/migrations/2019_08_21_225302_delete_encode_crids_ssp.php

In vscode I open the terminal and get this message: enter image description here

How I can make it to run this specific file, (not want all the files just this file)

Project tree: enter image description here

this is the code:

public function up()
    {
        Schema::table('ssp', function (Blueprint $table) {
            $table->dropColumn('encode_crids');
        });
    }

try to do again and get this: enter image description here

and again: enter image description here


Solution

  • If you want to re-run the migration with force, use migrate:refresh

    php artisan migrate:refresh --path=/database/migrations/2019_08_21_225302_delete_encode_crids_ssp.php
    

    With using refresh() command enter image description here

    With using fresh() command enter image description here