Добавьте файлы проекта.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Microsoft.SqlServer.TransactSql.ScriptDom;
|
||||
using SQLLinter.Common;
|
||||
using SQLLinter.Common.Helpers;
|
||||
|
||||
namespace SQLLinter.Infrastructure.Rules;
|
||||
|
||||
public class AlterInsteadOfCreateOrAlterRule : BaseRuleVisitor
|
||||
{
|
||||
public override string Text => "Запрещено использовать ALTER, допускается только CREATE OR ALTER: {0}.";
|
||||
|
||||
public override void Visit(AlterProcedureStatement node)
|
||||
{
|
||||
AddViolation(node, SQLHelpers.ObjectGetFullName(node.ProcedureReference.Name));
|
||||
}
|
||||
|
||||
public override void Visit(AlterFunctionStatement node)
|
||||
{
|
||||
AddViolation(node, SQLHelpers.ObjectGetFullName(node.Name));
|
||||
}
|
||||
|
||||
public override void Visit(AlterTriggerStatement node)
|
||||
{
|
||||
AddViolation(node, SQLHelpers.ObjectGetFullName(node.Name));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user