diff --git a/src/EntityFramework.MicrosoftSqlServer.Design/SqlServerDatabaseModelFactory.cs b/src/EntityFramework.MicrosoftSqlServer.Design/SqlServerDatabaseModelFactory.cs index 8148eda5149..162446ab9c2 100644 --- a/src/EntityFramework.MicrosoftSqlServer.Design/SqlServerDatabaseModelFactory.cs +++ b/src/EntityFramework.MicrosoftSqlServer.Design/SqlServerDatabaseModelFactory.cs @@ -214,6 +214,7 @@ FROM sys.indexes i INNER JOIN sys.columns c ON ic.object_id = c.object_id AND c.column_id = ic.column_id WHERE object_schema_name(i.object_id) <> 'sys' AND i.is_primary_key <> 1 + AND i.type IN (1,2) AND object_name(i.object_id) <> '" + HistoryRepository.DefaultTableName + @"' ORDER BY object_schema_name(i.object_id), object_name(i.object_id), i.name, ic.key_ordinal";