相关疑难解决方法(0)

未找到Laravel 5 Migrate Base表或视图:1146

我遇到了大问题.我试图朗读php artisan migrate生成表迁移,但我收到 php artisan list错误.我试过并在互联网上搜索,我误解了,但我没有得到任何解决方案.

我也试过基表或查看未找到:1146表Laravel 5做一个Laravel教程,得到"基表或视图未找到:1146表'sdbd_todo.migrations'不存在",但我没有成功.

我也试过跑php artisan migrate,但我又得到了同样的错误.我不知道为什么.请建议我的解决方案.

更新

**RolesPermission migration table**

Schema::create('roles', function(Blueprint $table){
            $table->increments('id');
            $table->string('name')->unique();
            $table->string('label');
            $table->string('description')->nullable();
            $table->timestamps();            
        });

        Schema::create('permissions', function(Blueprint $table){
            $table->increments('id');
            $table->string('name')->unique();
            $table->string('label');
            $table->string('description')->nullable();
            $table->timestamps();            
        });

        Schema::create('permission_role', function(Blueprint $table){
            $table->integer('permission_id')->unsigned();
            $table->integer('role_id')->unsigned();

            $table->foreign('permission_id')
                    ->references('id')
                    ->on('permissions')
                    ->onDelete('cascade');

            $table->foreign('role_id')
                    ->references('id')
                    ->on('roles')
                    ->onDelete('cascade');

            $table->primary(['permission_id', 'role_id']);
        });

        Schema::create('role_user', function(Blueprint $table){
            $table->integer('role_id')->unsigned();
            $table->integer('user_id')->unsigned();

            $table->foreign('role_id')
                    ->references('id')
                    ->on('roles')
                    ->onDelete('cascade');

            $table->foreign('user_id')
                    ->references('id')
                    ->on('users')
                    ->onDelete('cascade');

            $table->primary(['role_id', 'user_id']);

        });


.env file
APP_ENV=local
APP_DEBUG=true
APP_KEY=W8YWZe3LCngvZzexH3WLWqCDlYRSufuy

DB_HOST=127.0.0.1 …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5

10
推荐指数
5
解决办法
1万
查看次数

标签 统计

laravel ×1

laravel-5 ×1

php ×1