Beispiel #1
0
        IAddedUniqueConstraint IExistingTable.AddUniqueConstraint(string constraintName)
        {
            var command = new AddUniqueConstraintCommand(_command, constraintName);

            _command.Add(command);
            return(new AddedUniqueConstraint(command));
        }
        public void Visit(StringBuilder builder, AddUniqueConstraintCommand command)
        {
            if (ExecuteCustomInterpreter(command))
            {
                return;
            }

            builder.AppendFormat("alter table {0} add constraint {1} unique ({2})",
                                 _dataBase.QuoteForTableName(PrefixTableName(command.TableName)),
                                 _dataBase.QuoteForColumnName(PrefixTableName(command.ConstraintName)),
                                 String.Join(", ", command.ColumnNames));

            _sqlStatements.Add(builder.ToString());
        }
Beispiel #3
0
 public AddedUniqueConstraint(AddUniqueConstraintCommand command)
 {
     _command = command;
 }