Back

SQLSTATE[42S02]: Base table or view not found: 1146 Table


ILOBA ISRAEL posted 2 weeks ago

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cmssystem.categories' doesn't exist (SQL: insert into categories (name, updated_at, created_at) values (Sports, 2019-04-08 22:10:00, 2019-04-08 22:10:00))

I try to run the migration command for reason I don't know it giving the error above, here my code

<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('posts', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title'); $table->text('content'); $table->integer('category_id'); $table->string('featured_img'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('posts'); } } <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateCategoriesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('categories'); } }

Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us