public UniqueTableIndex AddUniqueIndex(ITable table, Field[] fields) { var index = new UniqueTableIndex(table, TableIndex.GetColumnsFromFields(fields)); AddIndex(index); return(index); }
public UniqueTableIndex AddUniqueIndex(ITable table, IColumn[] columns) { var index = new UniqueTableIndex(table, columns); AddIndex(index); return(index); }
public virtual UniqueTableIndex?GenerateUniqueIndex(ITable table, UniqueIndexAttribute?attribute) { if (attribute == null) { return(null); } var result = new UniqueTableIndex(table, TableIndex.GetColumnsFromFields(this)) { AvoidAttachToUniqueIndexes = attribute.AvoidAttachToUniqueIndexes }; if (attribute.AllowMultipleNulls) { result.Where = IndexWhereExpressionVisitor.IsNull(this, false); } return(result); }