SQLSTATE [42S02]:未找到基表或视图:1146表'softwareproject.o_r_f_o_l_s'在laravel中不存在错误

问题描述 投票:0回答:1

如何解决这个问题呢?

错误:

SQLSTATE [42S02]:未找到基表或视图:1146表'softwareproject.o_r_f_o_l_s'不存在(SQL:插入`o_r_f_o_l_s`(`region`,`user_id`,`updated_at`,`created_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');
        }
    }
mysql laravel migration
1个回答
0
投票

粗心的错误..

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

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

© www.soinside.com 2019 - 2024. All rights reserved.