Skip to content

Commit

Permalink
Uniquify index names across all tables
Browse files Browse the repository at this point in the history
Fixes #15425
  • Loading branch information
AndriySvyryd committed Aug 9, 2019
1 parent 243a085 commit 7b05462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public virtual void ProcessModelFinalized(IConventionModelBuilder modelBuilder,
columns.Clear();
keys.Clear();
foreignKeys.Clear();
indexes.Clear();

foreach (var entityType in entityTypes)
{
Expand Down
8 changes: 6 additions & 2 deletions test/EFCore.SqlServer.FunctionalTests/UpdatesSqlServerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ public override void Identifiers_are_generated_correctly()
Assert.Equal(
"LoginEntityTypeWithAnExtremelyLongAndOverlyConvolutedNameThatIsUsedToVerifyThatTheStoreIdentifierGenerationLengthLimitIsWorkin~1",
entityType2.GetTableName());

Assert.Equal(
"PK_LoginDetails",
entityType2.GetKeys().Single().GetName());
Assert.Equal(
"ExtraPropertyWithAnExtremelyLongAndOverlyConvolutedNameThatIsUsedToVerifyThatTheStoreIdentifierGenerationLengthLimitIsWorkingCo~",
entityType2.GetProperties().ElementAt(1).GetColumnName());

Assert.Equal(
"ExtraPropertyWithAnExtremelyLongAndOverlyConvolutedNameThatIsUsedToVerifyThatTheStoreIdentifierGenerationLengthLimitIsWorkingC~1",
entityType2.GetProperties().ElementAt(2).GetColumnName());
Assert.Equal(
"IX_LoginEntityTypeWithAnExtremelyLongAndOverlyConvolutedNameThatIsUsedToVerifyThatTheStoreIdentifierGenerationLengthLimitIsWor~1",
entityType2.GetIndexes().Single().GetName());
}
}

Expand Down

0 comments on commit 7b05462

Please sign in to comment.