Read this first https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html
In the onUpgrade helper you can execute SQL statements to add columns, add/alter tables, drop tables, etc., whatever your need is. Here is some more info http://stackoverflow.com/questions/14419358/confusion-how-does-sqliteopenhelper-onupgrade-behave-and-together-with-impor On Thursday, November 5, 2015 at 5:07:54 AM UTC-5, Jags wrote: > > Hi All, > > I need to implement data migration in my app. I have an sqlitedb which is > synchronized to cloud. my problem is to find best way to handle data > migration on app update. > > my questions are below. > > - does my existing data and database get deleted on app upgrade ? > - is it possible to invoke a method on successful installation / upgrade ? > - is it possible to bundle an empty db with app in playstore ? > - is it possible to change the database schema of existing db or i need to > create new db with new schema and migrate and delete old db ? > - what is the best and google recommended way to handle this ? > > regards > j > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

