示例#1
0
        public string BuildIndexCreateSql(TableInfo table, IndexInfo index)
        {
            var indexName = string.Format("{0}_{1}", table.OutputTableName, index.Name);

            var unique = index.IsUnique ? "UNIQUE " : "";

            return(string.Format("CREATE {0}INDEX {1} ON {2} ({3});",
                                 unique, _escaper(indexName), _escaper(table.OutputTableName),
                                 string.Join(",", index.ColumnNames.Select(c => _escaper(c)))));
        }
示例#2
0
 public TableInfo AddIndex(IndexInfo indexInfo)
 {
     _indexes.Add(indexInfo);
     return(this);
 }