EF6 migration for C# statements generates incorrect SQL

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
cubigo
Posts: 1
Joined: Thu 04 May 2017 12:05

EF6 migration for C# statements generates incorrect SQL

Post by cubigo » Thu 04 May 2017 12:07

Migration statement:
RenameIndex(table: "ef_maintenance.Requests", name: "IX_RequestTypeId", newName: "IX_TypeId");

Generated SQL statement:
ALTER INDEX ef_maintenance."IX_Requests_RequestTypeId" RENAME TO ef_maintenance."IX_Requests_TypeId"

Should be:
ALTER INDEX ef_maintenance."IX_Requests_RequestTypeId" RENAME TO "IX_Requests_TypeId"

dotConnect for PostgreSQL Professional version: 7.8.862
PostgreSQL server version: 9.4.7

ALTER INDEX documentation: https://www.postgresql.org/docs/9.6/sta ... index.html (9.4 is identical for this purpose)

"ALTER INDEX [ IF EXISTS ] name RENAME TO new_name"

name
The name (possibly schema-qualified) of an existing index to alter.

new_name
The new name for the index.

new name may not be schema-qualified.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF6 migration for C# statements generates incorrect SQL

Post by Shalex » Tue 09 May 2017 18:21

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF6 migration for C# statements generates incorrect SQL

Post by Shalex » Fri 26 May 2017 15:10

The bug with renaming index via EF Code-First Migrations is fixed in the new version: viewtopic.php?f=3&t=35438.

Post Reply