Home > Blockchain >  Laravel; Nothing to migrate
Laravel; Nothing to migrate

Time:11-25

This is my Terminal:

php artisan migrate   

   INFO  Nothing to migrate.  

This is my database

enter image description here

This is my migrations file _create_students_table.php

public function up()
{
    Schema::create('students', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->string('nickname');
        $table->string('birth_date');
        $table->string('email');
        $table->string('phone');
        $table->string('password');
        $table->timestamps();
    });

    Schema::create('**customers**', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->string('nickname');
        $table->string('birth_date');
        $table->string('email');
        $table->string('phone');
        $table->string('password');
        $table->timestamps();
    });
}

I want to add 'customers' as you can see here. but when I type 'php artisan migrate' in terminal I see Nothing to migrate.

CodePudding user response:

The message tells you that there are no new migrations.

You have to execute this command

php artisan make:migration create_customers_table

And inside the file you have to include this

Schema::create('**customers**', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('name');
    $table->string('nickname');
    $table->string('birth_date');
    $table->string('email');
    $table->string('phone');
    $table->string('password');
    $table->timestamps();
});

Then you can run the command again php artisan migrate and should now create the table correctly.

  • Related