Skip to content

Commit 01c8fe3

Browse files
author
Meha Kaushik
committed
Fixing Cassandra schema and Mongo shard key null values
1 parent 4de9174 commit 01c8fe3

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/CosmosDB/CosmosDB/CosmosDBAccount/NewAzCosmosDBAccount.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public override void ExecuteCmdlet()
224224
databaseAccountCreateUpdateParameters.Capabilities = new List<Capability> { new Capability { Name = "EnableTable" } };
225225
break;
226226
}
227+
227228
ApiKind = null;
228229
}
229230
}

src/CosmosDB/CosmosDB/Models/PSCassandraSchema.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ public PSCassandraSchema()
2525

2626
public PSCassandraSchema(CassandraSchema cassandraSchema)
2727
{
28+
Columns = new List<PSColumn>();
29+
foreach (Column column in cassandraSchema.Columns)
30+
{
31+
Columns.Add(new PSColumn(column));
32+
}
33+
34+
PartitionKeys = new List<PSCassandraPartitionKey>();
35+
foreach (CassandraPartitionKey cassandraPartitionKey in cassandraSchema.PartitionKeys)
36+
{
37+
PartitionKeys.Add(new PSCassandraPartitionKey(cassandraPartitionKey));
38+
}
39+
40+
ClusterKeys = new List<PSClusterKey>();
41+
foreach (ClusterKey clusterKey in cassandraSchema.ClusterKeys)
42+
{
43+
ClusterKeys.Add(new PSClusterKey(clusterKey));
44+
}
2845
}
2946

3047
//

src/CosmosDB/CosmosDB/Models/PSMongoDBCollectionGetPropertiesResource.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public class PSMongoDBCollectionGetPropertiesResource
2121
{
2222
public PSMongoDBCollectionGetPropertiesResource(MongoDBCollectionGetPropertiesResource mongoDBCollectionGetPropertiesResource)
2323
{
24+
Id = mongoDBCollectionGetPropertiesResource.Id;
25+
if (mongoDBCollectionGetPropertiesResource.ShardKey != null)
26+
{
27+
ShardKey = new Dictionary<string, string>(mongoDBCollectionGetPropertiesResource.ShardKey);
28+
}
2429
List<PSMongoIndex> psMongoIndex = new List<PSMongoIndex>();
2530
if (mongoDBCollectionGetPropertiesResource.Indexes != null)
2631
{

0 commit comments

Comments
 (0)