[Laravel]:SQLSTATE [3F000]:无效的架构名称 [英] [Laravel]: SQLSTATE[3F000]: Invalid schema name
问题描述
构建Laravel项目(v。5.4版)时,运行 php artisan migration
时,我收到以下错误消息:
Building a Laravel project (v. 5.4) When I run php artisan migrate
I get the following error message:
[Illuminate\Database\QueryException]
SQLSTATE[3F000]: Invalid schema name: 7 ERROR: no schema has been selected
to create in (SQL: create table "migrations" ("id" serial primary key not
null, "migration" varchar(255) not null, "batch" integer not null))
这只是现在才开始发生,而我之前已经在这个项目中创建了一个模型并伴随着迁移而没有发生任何事情,并且没有更改我的.env文件或自初始设置起生效的config / database.php文件。我认为这可能与错误的Postgresql用户有关,但我登录了CLI,并
This just started happening now, whereas I've previously made a model and accompanying migration without incident in this very project, and have not changed my .env file or the config/database.php file since the initial setup that worked. I thought it might have something to do with being the wrong postgresql user, but I logged in to the CLI and SET ROLE
to the owner of the database in question. No effect.
推荐答案
如果您的架构名称不是 public,只需将其重命名为 public
if your schema name is not "public" just rename it "public"
这篇关于[Laravel]:SQLSTATE [3F000]:无效的架构名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!