6
votes

Running "php artisan migrate" does nothing: no database modifications, no message(olso no "nothing to migrate"), no error.

No records are being added to table migrations as well.

Previously, the command "php artisan migrate" was working fine.

One of the migration files in folder database/migrations has this content:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class VidsTableEdit14 extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vids', function(Blueprint $table)
        {
            //
            $table->integer('test');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('vids', function(Blueprint $table)
        {
            //
        });
    }

}

How to make "php artisan migrate" working?

3
Can you tell us what shows on the command line when you run the command? Also do these commands work? php artisan list and php artisan help migrateLoko
Hi, php artisan list and php artisan help migrate work as expected: php artisan list gives a list, and starts with "Laravel Framework version 5.0.31".Charles Vlug
php artisan help migrate output starts with:"Usage:" nothings seems wrong with those commandsCharles Vlug
What does it return when you run php artisan migrate ? Just the standard message that it succeeded?Loko
just a blank line - no messageCharles Vlug

3 Answers

1
votes

If the migration stops working suddenly there is probably a syntax error somewhere in one of your migrations. If you suddenly get a class not found error be suspicious of a syntax error.

0
votes

This same happened me, when I was trying to add soft delete to my table.

I created the migration and in the Schema::table function I typed "$table->softDelete();". Instead of

$table->softDeletes();

Notice the 's' for plural, I tried running migration and didn't get any error or message. I made it plural and it worked.

And I noticed that you didn't make down function().Try adding:

Schema::drop('vids');

And run the migration again.

0
votes

Error:

SQLSTATE[42S01] 
Migrating: 2014_10_12_000000_create_users_table

   Illuminate\Database\QueryException 
-------------
[php artisan migrate] 

Solution: Go to:

app\Http\Providers\AppServiceProvider
import ( use Illuminate\Support\Facades\Schema; ) 

And, inside the register() function, insert this code:

public function register()
{
     Schema::defaultStringLength(191); 
}

Then run:

php artisan migrate:fresh