You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Data.Schema.Sql
|
|
|
|
|
{
|
|
|
|
|
internal class ConstraintDrop : TableTransaction
|
|
|
|
|
{
|
|
|
|
|
public ConstraintDrop(ObjectIndex index)
|
|
|
|
|
{
|
|
|
|
|
Index = index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ObjectIndex Index { get; }
|
|
|
|
|
|
|
|
|
|
protected override async Task OnExecute()
|
|
|
|
|
{
|
|
|
|
|
await Context.Execute(CommandText);
|
|
|
|
|
}
|
|
|
|
|
private string CommandText
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var text = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
text.AppendLine($"ALTER TABLE {Escape(Context.Schema.Schema, Context.Schema.Name)} DROP CONSTRAINT {Index.Name};");
|
|
|
|
|
|
|
|
|
|
return text.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|