sqlstate[42s02]:找不到基表或视图:1146表'softwareproject.o\u r\u f\u o\u l\u s'在laravel中不存在错误

mitkmikd  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(373)

如何解决这个问题?
错误:
sqlstate[42s02]:找不到基表或视图:1146表'softwareproject.o\r\u f\u o\u l\u s'不存在(sql:insert into'o\u r\u f\u o\u l\u s'('region'、'user\u id'、'updated\u at'、'created\u at')值(4165dsf,3,2018-09-06 20:33:58,2018-09-06 20:33:58))
我的迁移:

<?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');
        }
    }
0qx6xfy6

0qx6xfy61#

粗心的错误。。

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

表名错误。我想这对一些用户解决这个问题是有帮助的。

相关问题