Page 1 of 1

EF6 migration for C# statements generates incorrect SQL

Posted: Thu 04 May 2017 12:07
by cubigo
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.

Re: EF6 migration for C# statements generates incorrect SQL

Posted: Tue 09 May 2017 18:21
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

Re: EF6 migration for C# statements generates incorrect SQL

Posted: Fri 26 May 2017 15:10
by Shalex
The bug with renaming index via EF Code-First Migrations is fixed in the new version: viewtopic.php?f=3&t=35438.