Page 1 of 1

RenameIndexOperation bug

Posted: Tue 13 Jan 2015 12:27
by imlex
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.

Re: RenameIndexOperation bug

Posted: Wed 14 Jan 2015 14:57
by Shalex
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.