0
votes

How to solve this problem?

error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'softwareproject.o_r_f_o_l_s' doesn't exist (SQL: insert into `o_r_f_o_l_s` (`region`, `user_id`, `updated_at`, `created_at`) values (4165dsF, 3, 2018-09-06 20:33:58, 2018-09-06 20:33:58))

my migration:

<?php

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

    class CreateORFOLsTable extends Migration
    {
        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up()
        {
            Schema::create('o_r_f_o_ls', function (Blueprint $table) {
                $table->increments('ORFOLId');
                $table->string('region');

                $table->integer('user_id')->unsigned();
                $table->foreign('user_id')->references('userId')->on('all_users');

                $table->timestamps();

            });
        }

        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            Schema::dropIfExists('o_r_f_o_ls');
        }
    }
1
Is that really the name of the table, or have you abbreviated it for your question? There's a 64 character limit on table names in MySQL. - Bill Karwin
Are you sure the error is coming from this migration? The error is on an insert, yet this migration doesn't have any inserts. - Kyle Challis

1 Answers

1
votes

careless mistake..

according to the model, table name should change as o_r_f_o_l_s.`

mistake is table name. I suppose it's helpful to some users solve that question.