无法使用Entity Framework Core 3.1.3更新数据库

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

我正在将EF Core用于ASP.Net Web API应用程序,并尝试从我的模型中创建PostgreSQL数据库(基本的Microsoft文档,例如)

我设法通过“ Add-Migration创建迁移,但是下一步,当我执行” Update-Database“时,出现此错误:

> fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
>   Failed executing DbCommand (15ms) [Parameters=[], CommandType='Text',
>   CommandTimeout='30'] CREATE TABLE "Blogs" (
>       "BlogId" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY,
>       "Url" text NULL,
>       CONSTRAINT "PK_Blogs" PRIMARY KEY ("BlogId") );
> Npgsql.PostgresException (0x80004005): 42601: erreur de syntaxe sur ou près de « GENERATED »
postgresql asp.net-core entity-framework-core ef-code-first ef-core-3.1
1个回答
0
投票
好因此,问题在于我想使用PostgreSQL 9.4,但是EF Core 3仅支持PostgreSQL 10及更高版本。
© www.soinside.com 2019 - 2024. All rights reserved.