Exemple #1
0
 private bool IndexDoesNotExist(Type type)
 {
     using (var command = _conn.CreateCommand())
     {
         command.CommandType = CommandType.Text;
         command.CommandText = string.Format(@"select count(*)
         from pg_indexes
         where schemaname = '{0}'
         and tablename = '{1}'
         and indexname = 'idx_{1}_body';", _tableInfo.Schema, _tableInfo.TableNameWithoutSchema(type));
         var indexCount = (Int64)command.ExecuteScalar();
         return(indexCount == 0);
     }
 }