Results 1 to 5 of 5

Thread: Best practice for data migration in localstorage

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    145
    Answers
    6
    Vote Rating
    2
      0  

    Default Answered: Best practice for data migration in localstorage

    I have a model that I store in 'localstorage'. The model started out with 4 fields (call it version 1) but over the course of development, I added a couple more fields to it (version 2). I now need to code for the situation where version 2 code encounters version 1 records in 'localstorage'. I refer to this as data migration. What is the best practice to handle this situation in Sencha Touch 2?

  2. It should ignore those fields and next time you sync you would likely loose that data.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    Technically it should just work. I don't see any reason why it wouldn't.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    145
    Answers
    6
    Vote Rating
    2
      0  

    Default adding new fields requires no code changes.

    Sounds like appending new fields and keeping the existing fields works with no code change needed. That's good to hear. I guess I haven't encountered a situation yet where I delete one of the existing fields in a record. Will the framework also handle that situation with no code change needed?

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    It should ignore those fields and next time you sync you would likely loose that data.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #5
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    145
    Answers
    6
    Vote Rating
    2
      0  

    Default thanks

    thanks for the info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •