Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
[client][managed][offline] drop the unused createdat column in operat…
Browse files Browse the repository at this point in the history
…ions table
  • Loading branch information
hasankhan committed Oct 16, 2014
1 parent 801f6da commit 8a30df4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Expand Up @@ -17,7 +17,6 @@ internal abstract class MobileServiceTableOperation : IMobileServiceTableOperati
public string TableName { get; private set; }
public string ItemId { get; private set; }
public JObject Item { get; set; }
public DateTime CreatedAt { get; private set; }

public MobileServiceTableOperationState State { get; internal set; }
public long Sequence { get; set; }
Expand Down Expand Up @@ -48,7 +47,6 @@ protected MobileServiceTableOperation(string tableName, string itemId)
{
this.Id = Guid.NewGuid().ToString();
this.State = MobileServiceTableOperationState.Pending;
this.CreatedAt = DateTime.UtcNow;
this.TableName = tableName;
this.ItemId = itemId;
this.Version = 1;
Expand Down Expand Up @@ -142,7 +140,6 @@ internal JObject Serialize()
{ "tableName", this.TableName },
{ "itemId", this.ItemId },
{ "item", this.Item != null && this.SerializeItemToQueue ? this.Item.ToString(Formatting.None) : null },
{ MobileServiceSystemColumns.CreatedAt, this.CreatedAt },
{ "sequence", this.Sequence },
{ "version", this.Version }
};
Expand Down Expand Up @@ -177,7 +174,6 @@ internal static MobileServiceTableOperation Deserialize(JObject obj)
{
operation.Id = obj.Value<string>(MobileServiceSystemColumns.Id);
operation.Sequence = obj.Value<long?>("sequence").GetValueOrDefault();
operation.CreatedAt = obj.Value<DateTime>(MobileServiceSystemColumns.CreatedAt);
operation.Version = obj.Value<long?>("version").GetValueOrDefault();
string itemJson = obj.Value<string>("item");
operation.Item = !String.IsNullOrEmpty(itemJson) ? JObject.Parse(itemJson) : null;
Expand Down
Expand Up @@ -79,7 +79,6 @@ public void Serialize_Succeeds()
Assert.AreEqual(serializedOperation["tableName"], "test");
Assert.AreEqual(serializedOperation["kind"], 0);
Assert.AreEqual(serializedOperation["item"], JValue.CreateString(null));
Assert.IsNotNull(serializedOperation["__createdAt"]);
Assert.IsNotNull(serializedOperation["sequence"]);
}

Expand All @@ -95,7 +94,6 @@ public void Deserialize_Succeeds()
Assert.AreEqual(serializedOperation["tableName"], operation.TableName);
Assert.AreEqual(MobileServiceTableOperationKind.Insert, operation.Kind);
Assert.IsNull(operation.Item);
Assert.AreEqual(serializedOperation["__createdAt"], operation.CreatedAt);
Assert.AreEqual(serializedOperation["sequence"], operation.Sequence);
}

Expand All @@ -121,7 +119,6 @@ public void Deserialize_Succeeds_WithItem()
Assert.AreEqual(serializedOperation["version"], operation.Version);
Assert.AreEqual(serializedOperation["tableName"], operation.TableName);
Assert.AreEqual(MobileServiceTableOperationKind.Delete, operation.Kind);
Assert.AreEqual(serializedOperation["__createdAt"], operation.CreatedAt);
Assert.AreEqual(serializedOperation["sequence"], operation.Sequence);
Assert.AreEqual("abc", operation.Item["id"]);
Assert.AreEqual("example", operation.Item["text"]);
Expand All @@ -148,7 +145,6 @@ public void Deserialize_Succeeds_WhenVersionSequenceOrStateIsNull()
Assert.AreEqual(serializedOperation["itemId"], operation.ItemId);
Assert.AreEqual(serializedOperation["tableName"], operation.TableName);
Assert.AreEqual(MobileServiceTableOperationKind.Delete, operation.Kind);
Assert.AreEqual(serializedOperation["__createdAt"], operation.CreatedAt);
Assert.AreEqual(serializedOperation["sequence"], operation.Sequence);
Assert.AreEqual(0, operation.Version);
Assert.AreEqual("abc", operation.Item["id"]);
Expand Down

0 comments on commit 8a30df4

Please sign in to comment.