No puedo crear la migracion en laravel 5.8, me muestra el siguien error
Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'articles' already exists (SQL: create table articles
(id
bigint unsigned not null auto_increment primary key, author_id
int unsigned not null, title
varchar(191) not null, created_at
timestamp null, updated_at
timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('article_id');
$table->unsignedBigInteger('author_id');
$table->text('body');
$table->timestamps();
//FK
$table->foreign('article_id')
->references('id')->on('articles')
->onDelete('cascade');
$table->foreign('author_id')
->references('id')->on('people')
->onDelete('cascade');
$table->index('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropForeign('article_id');
Schemma::dropForeign('author_id');
Schema::dropIndex('dropIndex');
Schemma::dropPrimary('comments');
}
}
articles
add constraintarticles_author_id_foreign
foreign key (author_id
) referencespeople
(id
)) me sigue mostrando este errorphp artisan migrate:fresh
para que elimine todas las tablas antes de ejecutar las migraciones nuevamente