Exemplo n.º 1
0
        public void Test_MS_CreateClusteredIndex()
        {
            Initialize(_msContext);
            _commands.ExecuteNonQuery(string.Format("create table {0} (id int, id2 int, id3 int)", _testTable));
            IIndexDefinition index = _msContext.PowerPlant.CreateIndexDefinition("i1_" + _testTable, _testTable, "", true, 0, true);

            index.Columns = new List <IIndexColumn> {
                IndexColumnFactory.CreateInstance("id")
            };
            _dbSchema.CreateIndex(index);
            CheckIndexIsClustered();
        }
Exemplo n.º 2
0
 private void ClusteredIndexOnAgrtid(ITableDefinition tableDefinition)
 {
     if (CreateClusteredIndex && _dbContext.DbType == DbTypeName.SqlServer)
     {
         var index = _dbContext.PowerPlant.CreateIndexDefinition(
             "aic_" + tableDefinition.Name,
             tableDefinition.Name,
             tableDefinition.Location,
             true, /* is unique */
             0,    /* id */
             true /* is clustered */);
         index.Columns = new List <IIndexColumn> {
             IndexColumnFactory.CreateInstance("agrtid")
         };
         _dbSchema.CreateIndex(index);
     }
 }