2016-01-12 44 views
1

我刚刚开始使用laravel 5.2 ..这是一个简单的迁移文件,但是当我运行php artisan migrate命令时,我得到了屏幕截图中显示的错误。我现在应该怎么做?Laravel 5.2基表或查看未找到错误

迁移文件

<?php 

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

class CreateProductCategoryTable extends Migration 
{ 
    /** 
    * Run the migrations. 
    * 
    * @return void 
    */ 
    public function up() 
    { 
     Schema::table('product_category', function (Blueprint $table) { 
      $table->increments('id'); 
      $table->string('product_category_name'); 
      $table->timestamps(); 
     }); 
    } 

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

enter image description here

回答

3

您需要更改Schema::tableSchema::create

0

对我来说,这是因为我通过Task :: all()循环通过自己的自定义Task对象动态地在Kernel.php中注册了Scheduled Tasks。但我的'任务'数据库表尚未创建但导致错误。所以我评论了Kernel.php代码,运行php artisan migrate命令,然后取消注释我的Kernel.php代码。 不确定,但可能是最好的尝试{dbCode; }在Kernel.php代码中捕获{doNothing;}。

相关问题