RenameIndexOperation bug

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
imlex
Posts: 1
Joined: Tue 13 Jan 2015 11:44

RenameIndexOperation bug

Post by imlex » Tue 13 Jan 2015 12:27

Hello.

We have found bug in processing of RenameIndexOperation migration operation. Index names (old and new) are always modified to contain table name regardless of their values and source (default index name or manually specified). So index 'IX_BLABLABLA' becomes 'IX_TABLENAME_BLABLABLA'.

In our migrations we manually provide index names to conform Oracle name length limit and to control resulting names format.

Migration02:
CreateIndex(@"CityInventory.NonResidentals", @"LegalMode_Id", name: @"IX_NonResidentals_LegalMode_Id");

Migration03:
RenameIndex(table: @"CityInventory.NonResidentals", name: @"IX_NonResidentals_LegalMode_Id", newName: @"IX_NonResidentals_LegalModeId");

And third migration cannot be applied due to transformed name 'IX_NonResidentals_NonResidentals_LegalMode_Id' exceeded name length limit.

Can you fix this bug or add workarounds flag for this issue?

Regards,
Alexey.

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

Re: RenameIndexOperation bug

Post by Shalex » Wed 14 Jan 2015 14:57

imlex wrote:Index names (old and new) are always modified to contain table name regardless of their values and source (default index name or manually specified). So index 'IX_BLABLABLA' becomes 'IX_TABLENAME_BLABLABLA'.
We cannot reproduce the issue at the moment.

1. This scenario adds a table name (by design):
Code

Code: Select all

    [Index]
    public virtual global::System.Nullable<int> Property1
Generated migration

Code: Select all

        .Index(t => t.Property1);
Result SQL

Code: Select all

CREATE INDEX ALEXSH."IX_tests_Property1" ON ALEXSH."tests" ("Property1")
2. There is no table name in case of explicitly specified index name:
Code

Code: Select all

    [Index("IX_BLABLABLA")]
    public virtual global::System.Nullable<int> Property1
Generated migration

Code: Select all

        .Index(t => t.Property1, name: "IX_BLABLABLA");
Result SQL

Code: Select all

CREATE INDEX IX_BLABLABLA ON ALEXSH."tests" ("Property1")
Please tell us the exact (x.x.x) version of your dotConnect for Oracle, send us a small complete test project and specify the steps we should follow using it to reproduce the problem you have encountered.

Post Reply