enable table designer for sqlproj (#1511)

* enable table designer for sqlproj

* return issues and new table info on initialization

* vbump dacfx

* Revert "vbump dacfx"

This reverts commit f59768b41f67866bd7620e06b141e8bfdb1523aa.
This commit is contained in:
Alan Ren
2022-06-01 14:17:04 -07:00
committed by GitHub
parent fed1cef7bf
commit 63bef2b904
6 changed files with 73 additions and 17 deletions

View File

@@ -32,7 +32,8 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
new TableMustHaveAtLeastOneColumnRule(),
new MemoryOptimizedTableIdentityColumnRule(),
new TableShouldAvoidHavingMultipleEdgeConstraintsRule(),
new ColumnCannotBeListedMoreThanOnceInPrimaryKeyRule()
new ColumnCannotBeListedMoreThanOnceInPrimaryKeyRule(),
new MutipleCreateTableStatementsInScriptRule()
};
/// <summary>
@@ -578,4 +579,20 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
return errors;
}
}
public class MutipleCreateTableStatementsInScriptRule : ITableDesignerValidationRule
{
public List<TableDesignerIssue> Run(Dac.TableDesigner designer)
{
var errors = new List<TableDesignerIssue>();
if(designer.ScriptContainsMultipleTableDefinition)
{
errors.Add(new TableDesignerIssue(){
Description = "There are multiple table definitions in the script, only the first table can be edited in the designer.",
Severity = Contracts.IssueSeverity.Information
});
}
return errors;
}
}
}