Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 找不到基表或视图:1146表';epharmacy.药物';不';不存在_Php_Laravel 5.3 - Fatal编程技术网

Php 找不到基表或视图:1146表';epharmacy.药物';不';不存在

Php 找不到基表或视图:1146表';epharmacy.药物';不';不存在,php,laravel-5.3,Php,Laravel 5.3,我正在尝试构建一个表,但当我运行此命令“php artisan migrate”时,出现以下错误: [照亮\数据库\查询异常] SQLSTATE[42S02]:未找到基表或视图:1146表的epharmacy.medici “nes”不存在(SQL:alter tablemedicinesaddidint unsigned not 空自动递增主键,添加namevarchar(255)非空,添加typ evarchar(255)不为空,添加potencyvarchar(255)不为空,添加crea

我正在尝试构建一个表,但当我运行此命令“php artisan migrate”时,出现以下错误:

[照亮\数据库\查询异常]
SQLSTATE[42S02]:未找到基表或视图:1146表的epharmacy.medici
“nes”不存在(SQL:alter table
medicines
add
id
int unsigned not
空自动递增主键,添加
name
varchar(255)非空,添加
typ
e
varchar(255)不为空,添加
potency
varchar(255)不为空,添加
created
_在
timestampnull处,添加updated\u在timestampnull处)

迁移:

<?php

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

class CreateMedicineTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('medicines', function (Blueprint $table) {
            $table->increments('id');
            $table->String('name');
            $table->String('type');
            $table->String('potency');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('medicines', function (Blueprint $table) {
            //
        });
    }
}
根据,它需要:

<?php

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

class CreateMedicineTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('medicines', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('type');
            $table->string('potency');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('medicines');
    }    

将类名createmedicinetable更改为criatemedicines表,然后重试