none
Mobile Services Sync - UpdatedAt RRS feed

  • Question

  • It appears that when I create new records on the client that get sync'd to the server and inserted into target database they are being inserted with UpdatedAt = null.  

    If I do a PurgeAsync on one of those tables and refresh or even uninstall app and re-download everything fresh I do not get any of the records back that have UpdatedAt = null.

    If I update all the sync'd records to set UpdatedAt = CreatedAt then I do get the items downloaded.

    Is this my own ID-10-T error or is this a bug?  Should the database tables be created with a default on UpdatedAt as well?

    Thursday, June 2, 2016 5:28 PM

Answers

  • Hi Jeff,

    The updatedAt column is normally updated by a SQL Server trigger that is created when the table is created. You can see the SQL code for the trigger at https://github.com/Azure/azure-mobile-apps-net-server/blob/master/src/Microsoft.Azure.Mobile.Server.Entity/Tables/EntityTableSqlGenerator.cs#L119.

    These will be created automatically by the server SDK, but if you're running against an existing database or one that you have created manually, the trigger may not exist.

    Hope this helps!

    Thursday, June 2, 2016 8:28 PM

All replies

  • Hi Jeff,

    The updatedAt column is normally updated by a SQL Server trigger that is created when the table is created. You can see the SQL code for the trigger at https://github.com/Azure/azure-mobile-apps-net-server/blob/master/src/Microsoft.Azure.Mobile.Server.Entity/Tables/EntityTableSqlGenerator.cs#L119.

    These will be created automatically by the server SDK, but if you're running against an existing database or one that you have created manually, the trigger may not exist.

    Hope this helps!

    Thursday, June 2, 2016 8:28 PM
  • Ah.  Yes I am creating the tables manually and I missed that there was a trigger created on the TodoItem sample table.  It was an ID-10-T error.  Thanks.
    Thursday, June 2, 2016 8:55 PM
  • Thanks!

    Héctor Uriel Pérez Rojas, DCE2005 GOLD, hectorperezspace.spaces.live, hectorperezspace.wordpress.com

    Wednesday, May 8, 2019 6:12 PM