Пример #1
0
 static void Drop(ElementCode context, string tableName, IIndexDef index)
 {
     if (index == null)
     {
         return;
     }
     context.Add(SqlKeyword.DropIndex, SqlKeyword.IfExists);
     context.Concat(index.Name);
     context.Go();
 }
Пример #2
0
 static void Add(ElementCode context, string tableName, IIndexDef index)
 {
     if (index == null)
     {
         return;
     }
     context.Add(SqlKeyword.CreateIndex, SqlKeyword.IfNotExists);
     context.Concat(index.Name);
     context.Add(SqlKeyword.On);
     context.Concat(tableName);
     if ((index.Flags & IndexFlags.Gin) != 0)
     {
         context.Add(SqlKeyword.Using);
         context.Concat("gin");
     }
     context.AddColumnDefs(index.Columns);
     context.Go();
 }