Npgsql.PostgresException (0x80004005): 42601: syntax error at or near "INCLUDE"

0

I m working with PostgresSql & EF core 3.1. I created an index for one of my entity as follow

builder.HasIndex(e => e.MerchantId).IncludeProperties(e=>e.TemplateType);

in migration file i can see the below

migrationBuilder.CreateIndex(
                name: "IX_EmailTemplates_MerchantId",
                table: "EmailTemplates",
                column: "MerchantId")
                .Annotation("Npgsql:IndexInclude", new[] { "TemplateType" });

When run update-database I m getting the below Error.

Failed executing DbCommand (24ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE INDEX "IX_EmailTemplates_MerchantId" ON "EmailTemplates" ("MerchantId") INCLUDE ("TemplateType");
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (24ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE INDEX "IX_EmailTemplates_MerchantId" ON "EmailTemplates" ("MerchantId") INCLUDE ("TemplateType");
**Npgsql.PostgresException (0x80004005): 42601: syntax error at or near "INCLUDE"**

Any one can help me on this error ?

postgresql
entity-framework-core
ef-core-3.1
asked on Stack Overflow Jul 11, 2020 by Suresh M • edited Jul 11, 2020 by scaisEdge

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0