[Table Designer] Fix a few computed col issues (#1518)

This commit is contained in:
Hai Cao
2022-06-01 15:00:01 -07:00
committed by GitHub
parent 9a341c6bd9
commit 33636efa87
2 changed files with 3 additions and 3 deletions

View File

@@ -825,7 +825,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
columnViewModel.IsPrimaryKey.Enabled = true; // To be consistent with SSDT, any column can be a primary key.
columnViewModel.Type.Value = column.DataType;
columnViewModel.Type.Enabled = column.CanEditDataType;
columnViewModel.Type.Values = tableDesigner.DataTypes.ToList();
columnViewModel.Type.Values = column.DataTypes.ToList();
columnViewModel.AdvancedType.Value = column.AdvancedDataType;
columnViewModel.AdvancedType.Enabled = column.CanEditDataType;
columnViewModel.AdvancedType.Values = column.AdvancedDataTypes.ToList();

View File

@@ -473,11 +473,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
{
var table = designer.TableViewModel;
var errors = new List<TableDesignerIssue>();
if (!table.IsEdge && table.Columns.Items.Count == 0)
if (!table.IsEdge && table.Columns.Items.Where(c => !c.IsComputed).Count() == 0)
{
errors.Add(new TableDesignerIssue()
{
Description = "A table must have at least one column defined."
Description = "A table must have at least one non-computed column defined."
});
}
return errors;