-
20 Mar 2012 11:48 AM #1
Answered: Best practice for data migration in localstorage
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?
-
Best Answer Posted by mitchellsimoens
It should ignore those fields and next time you sync you would likely loose that data.
-
21 Mar 2012 4:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3106
Technically it should just work. I don't see any reason why it wouldn't.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Mar 2012 6:12 AM #3
adding new fields requires no code changes.
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?
-
21 Mar 2012 6:16 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3106
It should ignore those fields and next time you sync you would likely loose that data.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Mar 2012 6:55 AM #5
thanks
thanks
thanks for the info.


Reply With Quote