【发布时间】:2020-08-05 20:10:27
【问题描述】:
我将 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