diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml index b7d39c9d..e0ea4c05 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeDefinition.xml @@ -194,7 +194,7 @@ - + IndexKeyType.DriPrimaryKey @@ -209,6 +209,8 @@ IndexKeyType.None + IndexKeyType.DriPrimaryKey + IndexKeyType.DriUniqueKey diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs index 27a756c5..5fe4a6e2 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs @@ -1319,6 +1319,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel NodeType = "Folder", NodeTypeId = NodeTypes.Keys, IsSystemObject = false, + ValidFor = ValidForFlag.NotSqlDw, SortPriority = SmoTreeNode.NextSortPriority, }); currentChildren.Add(new FolderNode { @@ -1602,7 +1603,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12, Values = new List { - { IndexKeyType.None } + { IndexKeyType.None }, + { IndexKeyType.DriPrimaryKey }, + { IndexKeyType.DriUniqueKey } } }); return filters; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt index 4e2bce73..4a8f81a1 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt +++ b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestData/ObjectExplorer/Baselines/AllSqlObjects.txt @@ -42,6 +42,7 @@ NodeType: Constraint Label: CK_Employee_MaritalStatus SubType: Status: NodeType: Constraint Label: CK_Employee_SickLeaveHours SubType: Status: NodeType: Constraint Label: CK_Employee_VacationHours SubType: Status: NodeType: Index Label: NonClusteredIndex-Login (Non-Unique, Non-Clustered) SubType: Status: +NodeType: Index Label: PK_Employee_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status: NodeType: Statistic Label: NonClusteredIndex-Login SubType: Status: NodeType: Statistic Label: PK_Employee_BusinessEntityID SubType: Status: NodeType: Table Label: HumanResources.Employee_Temporal (System-Versioned) SubType:Temporal Status: @@ -60,6 +61,7 @@ NodeType: Column Label: SickLeaveHours (smallint, not null) SubType: Status: NodeType: Column Label: ValidFrom (datetime2(7), not null) SubType: Status: NodeType: Column Label: ValidTo (datetime2(7), not null) SubType: Status: NodeType: Key Label: PK_Employee_History_BusinessEntityID SubType:PrimaryKey Status: +NodeType: Index Label: PK_Employee_History_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status: NodeType: Statistic Label: PK_Employee_History_BusinessEntityID SubType: Status: NodeType: HistoryTable Label: HumanResources.Employee_Temporal_History (History) SubType: Status: NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status: @@ -93,6 +95,7 @@ NodeType: Key Label: PK_Person_BusinessEntityID SubType:PrimaryKey Status: NodeType: Constraint Label: CK_Person_EmailPromotion SubType: Status: NodeType: Constraint Label: CK_Person_PersonType SubType: Status: NodeType: Trigger Label: TableTrigger SubType: Status: +NodeType: Index Label: PK_Person_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status: NodeType: Statistic Label: PK_Person_BusinessEntityID SubType: Status: NodeType: View Label: HumanResources.vEmployee SubType: Status: NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status: