diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
index b5873445..bd28ccb4 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
@@ -2045,6 +2045,14 @@ namespace Microsoft.SqlTools.ServiceLayer
}
}
+ public static string SchemaHierarchy_DroppedLedgerColumns
+ {
+ get
+ {
+ return Keys.GetString(Keys.SchemaHierarchy_DroppedLedgerColumns);
+ }
+ }
+
public static string SchemaHierarchy_DroppedLedgerTables
{
get
@@ -10877,6 +10885,9 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string SchemaHierarchy_ExternalTables = "SchemaHierarchy_ExternalTables";
+ public const string SchemaHierarchy_DroppedLedgerColumns = "SchemaHierarchy_DroppedLedgerColumns";
+
+
public const string SchemaHierarchy_DroppedLedgerTables = "SchemaHierarchy_DroppedLedgerTables";
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
index 3787f1f8..642cc2fd 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
@@ -1280,6 +1280,10 @@
External Tables
+
+ Dropped Ledger Columns
+
+
Dropped Ledger Tables
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
index f0663eb9..186cc61b 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
@@ -630,6 +630,8 @@ SchemaHierarchy_ExternalResources = External Resources
SchemaHierarchy_ExternalTables = External Tables
+SchemaHierarchy_DroppedLedgerColumns = Dropped Ledger Columns
+
SchemaHierarchy_DroppedLedgerTables = Dropped Ledger Tables
SchemaHierarchy_DroppedLedgerViews = Dropped Ledger Views
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
index 90d71ea0..db6e574a 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
@@ -6331,6 +6331,11 @@ The Query Processor estimates that implementing the following index could improv
Dropped Ledger Views
+
+ Dropped Ledger Columns
+ Dropped Ledger Columns
+
+
Could not find SQL model from project: {0}.
Could not find SQL model from project: {0}.
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeObservableCollection.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeObservableCollection.cs
index d7e90f73..af31d14e 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeObservableCollection.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeObservableCollection.cs
@@ -38,7 +38,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
bool anyDroppedFolders = this.Any(
node => node is FolderNode &&
(node.NodeTypeId == NodeTypes.DroppedLedgerTables ||
- node.NodeTypeId == NodeTypes.DroppedLedgerViews));
+ node.NodeTypeId == NodeTypes.DroppedLedgerViews ||
+ node.NodeTypeId == NodeTypes.DroppedLedgerColumns));
return this.FirstOrDefault() is SmoTreeNode && !anyDroppedFolders;
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
index 81bd1c91..14fcc15a 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
@@ -142,5 +142,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
ColumnEncryptionKeys,
DroppedLedgerTables,
DroppedLedgerViews,
+ DroppedLedgerColumns,
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
index de8c3682..3e97a374 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
@@ -53,6 +53,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
allChildren.RemoveAll(x => x.IsSystemObject);
}
+
if (context != null && context.ValidFor != 0 && context.ValidFor != ValidForFlag.All)
{
allChildren.RemoveAll(x =>
@@ -64,6 +65,22 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
return false;
});
+
+ // Remove the Dropped Ledger Columns folder if this isn't under a ledger table
+ allChildren.RemoveAll(x =>
+ {
+ if (x.NodeTypeId == NodeTypes.DroppedLedgerColumns)
+ {
+ Table? parentTable = context.Parent as Table;
+ if (parentTable == null ||
+ !(parentTable.LedgerType == LedgerTableType.UpdatableLedgerTable ||
+ parentTable.LedgerType == LedgerTableType.AppendOnlyLedgerTable))
+ {
+ return true;
+ }
+ }
+ return false;
+ });
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoColumnCustomNode.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoColumnCustomNode.cs
index e23f643c..f4c39857 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoColumnCustomNode.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoColumnCustomNode.cs
@@ -89,6 +89,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
Name = "XmlDocumentConstraint",
ValidFor = ValidForFlag.NotSqlDw
+ },
+ new NodeSmoProperty
+ {
+ Name = "IsDroppedLedgerColumn",
+ ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12
}
});
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
index e957de74..2ecf3587 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
@@ -1644,6 +1644,34 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
public override IEnumerable ApplicableParents() { return new[] { "Columns" }; }
+ public override IEnumerable Filters
+ {
+ get
+ {
+ var filters = new List();
+ filters.Add(new NodePropertyFilter
+ {
+ Property = "IsDroppedLedgerColumn",
+ Type = typeof(bool),
+ ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
+ Values = new List