小编Mah*_*rli的帖子

无法启动Laravel,我得到"Base table or view not found"错误

首先我错误地回滚了2次迁移,然后我运行php artisan migrate命令,我收到以下错误:

[Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'exercise1.categories' doesn't exist (SQL: select * from categories where parent_id = 0) [PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'exercise1.categories' doesn't exist

然后我停止了拉拉维尔.之后,当我运行php artisan serve启动Laravel 的命令时,我得到了同样的错误.以下是我已回滚的2次迁移:

1.

class CreateCategoriesTable extends Migration
    {

        public function up()
        {
            Schema::create('categories',function (Blueprint $table){
                $table->increments('id');
                $table->string('name');
                $table->text('parent_id');
                $table->timestamps();
        });
        }
        public function down()
        {
            Schema::dropIfExists('categories');
        }
    }
Run Code Online (Sandbox Code Playgroud)

2.

class CreateArticlesTable extends Migration
    {
        public function …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-migrations

9
推荐指数
1
解决办法
6435
查看次数

标签 统计

laravel ×1

laravel-migrations ×1

php ×1