Laravel迁移在添加新迁移时不起作用

时间:2020-09-22 19:10:13

标签: mysql laravel migration portfolio laravel-8

<?php

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

class CreatePortfoliosTable extends Migration
{
    public function up()
    {

        Schema::create('portfolios', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('image_1');
            $table->string('image_2');
            $table->timestamps();
        });
    }

   
}

我创建此迁移,然后运行它 PHP工匠可以迁移,但不起作用。

我正在使用最新版本的8级 我该怎么办?

C:\xampp\htdocs\shahabuddin>php artisan migrate
Migrating: 2014_10_12_000000_create_users_table

   Illuminate\Database\QueryException 

  SQLSTATE[42S01]: Base table or view already exists: 


  1   C:\xampp\htdocs\shahabuddin\vendor\laravel\framework\src\Illuminate\Database\Connection.php:464
      PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists")

  2   C:\xampp\htdocs\shahabuddin\vendor\laravel\framework\src\Illuminate\Database\Connection.php:464
      PDOStatement::execute()

我遇到了那些错误

0 个答案:

没有答案