Update ledger object SubTypes so they can be utilized for context menu handling (#1677)

This commit is contained in:
Jordan Hays
2022-09-08 12:24:36 -07:00
committed by GitHub
parent 8c9c3359c3
commit c2b0e33c9c
2 changed files with 13 additions and 7 deletions

View File

@@ -54,10 +54,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
try try
{ {
Table? table = smoObject as Table; Table? table = smoObject as Table;
if (table != null && IsPropertySupported("LedgerType", smoContext, table, CachedSmoProperties) && if (table != null && IsPropertySupported("LedgerType", smoContext, table, CachedSmoProperties))
(table.LedgerType == LedgerTableType.AppendOnlyLedgerTable || table.LedgerType == LedgerTableType.UpdatableLedgerTable))
{ {
return "Ledger"; if (table.LedgerType == LedgerTableType.AppendOnlyLedgerTable)
{
return "LedgerAppendOnly";
}
if (table.LedgerType == LedgerTableType.UpdatableLedgerTable)
{
return "LedgerUpdatable";
}
} }
if (table != null && IsPropertySupported("TemporalType", smoContext, table, CachedSmoProperties) && table.TemporalType != TableTemporalType.None) if (table != null && IsPropertySupported("TemporalType", smoContext, table, CachedSmoProperties) && table.TemporalType != TableTemporalType.None)
{ {
@@ -177,7 +183,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
public override string GetNodeSubType(object smoObject, SmoQueryContext smoContext) public override string GetNodeSubType(object smoObject, SmoQueryContext smoContext)
{ {
return "Ledger"; return "LedgerDropped";
} }
public override string GetNodePathName(object smoObject) public override string GetNodePathName(object smoObject)

View File

@@ -51,7 +51,7 @@ NodeType: Index Label: NonClusteredIndex-Login (Non-Unique, Non-Clustered) SubTy
NodeType: Index Label: PK_Employee_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status: NodeType: Index Label: PK_Employee_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status:
NodeType: Statistic Label: NonClusteredIndex-Login SubType: Status: NodeType: Statistic Label: NonClusteredIndex-Login SubType: Status:
NodeType: Statistic Label: PK_Employee_BusinessEntityID SubType: Status: NodeType: Statistic Label: PK_Employee_BusinessEntityID SubType: Status:
NodeType: Table Label: HumanResources.Employee_Ledger (Updatable Ledger) SubType:Ledger Status: NodeType: Table Label: HumanResources.Employee_Ledger (Updatable Ledger) SubType:LedgerUpdatable Status:
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status: NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status: NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status: NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status:
@@ -85,7 +85,7 @@ NodeType: Column Label: ledger_start_transaction_id (bigint, not null) SubType:
NodeType: Column Label: ledger_end_transaction_id (bigint, null) SubType: Status: NodeType: Column Label: ledger_end_transaction_id (bigint, null) SubType: Status:
NodeType: Column Label: ledger_start_sequence_number (bigint, not null) SubType: Status: NodeType: Column Label: ledger_start_sequence_number (bigint, not null) SubType: Status:
NodeType: Column Label: ledger_end_sequence_number (bigint, null) SubType: Status: NodeType: Column Label: ledger_end_sequence_number (bigint, null) SubType: Status:
NodeType: Table Label: HumanResources.Employee_Ledger_AppendOnly (Append-Only Ledger) SubType:Ledger Status: NodeType: Table Label: HumanResources.Employee_Ledger_AppendOnly (Append-Only Ledger) SubType:LedgerAppendOnly Status:
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status: NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status: NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status: NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status:
@@ -160,7 +160,7 @@ NodeType: Constraint Label: DF_Person_ModifiedDate SubType: Status:
NodeType: Trigger Label: TableTrigger SubType: Status: NodeType: Trigger Label: TableTrigger SubType: Status:
NodeType: Index Label: PK_Person_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status: NodeType: Index Label: PK_Person_BusinessEntityID (Unique, Clustered) SubType:PrimaryKey Status:
NodeType: Statistic Label: PK_Person_BusinessEntityID SubType: Status: NodeType: Statistic Label: PK_Person_BusinessEntityID SubType: Status:
NodeType: Table Label: HumanResources.MSSQL_DroppedLedgerTable_Ledger_For_Drop_<<NonDeterministic>> (Updatable Ledger) SubType:Ledger Status: NodeType: Table Label: HumanResources.MSSQL_DroppedLedgerTable_Ledger_For_Drop_<<NonDeterministic>> (Updatable Ledger) SubType:LedgerDropped Status:
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status: NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status: NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status: NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status: