首先我错误地回滚了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)