Error Base table or view already exists: 1050 Table 'users' when migrating Laravel 5.5

1

I find an error when performing the migration in Laravel 5.5

This is the code of my migration file:

<?php

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

class CreateProfessionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('profesiones', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('profesiones');
    }
}
    
asked by Javier 18.08.2018 в 07:07
source

1 answer

1

The message is clear, the user table (users) already exists in its database. You have several options, I will mention two

  • Delete table users from the database manually and execute php artisan migrate
  • Simply execute the php artisan migrate:fresh command
  • If you have seeders remember to add at the end --seed for the two options.

        
    answered by 18.08.2018 / 07:45
    source