Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dropped ledger columns from Edit Data columns #1691

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public EditTableMetadata GetObjectMetadata(DbConnection connection, string[] obj
throw new ArgumentOutOfRangeException(nameof(objectNamedParts), SR.EditDataObjectNotFound);
}

// Filter out dropped ledger columns from the list of columns to be returned
// and grab the specific column properties checked below
smoResult.Columns.ClearAndInitialize("[(@IsDroppedLedgerColumn=0)]", new [] { nameof(Column.DataType), nameof(Column.DefaultConstraintName) });

// Generate the edit column metadata
List<EditColumnMetadata> editColumns = new List<EditColumnMetadata>();
for (int i = 0; i < smoResult.Columns.Count; i++)
Expand All @@ -103,7 +107,7 @@ public EditTableMetadata GetObjectMetadata(DbConnection connection, string[] obj
try
{
// The default value may be escaped
defaultValue = smoColumn.DefaultConstraint == null
defaultValue = string.IsNullOrEmpty(smoColumn.DefaultConstraintName)
? null
: FromSqlScript.UnwrapLiteral(smoColumn.DefaultConstraint.Text);
}
Expand Down