0

I have developed application which is related to sqlite database.

when added enhancement for the application there is change in database, so i have changed database by adding extra tables into existing db.

Now when all-ready exist application in device [which is version 1] update to new feature of the app. The database is not changed for version 2.

Can any one give me advice how to reflect the db for the version 2.

@advance Thanks

kiran
  • 4,285
  • 7
  • 53
  • 98

2 Answers2

1

I have answered a similar question here, I think it can help you. The idea is to detect if your app is launching for the first time after the installation or not. If it is launching for the first time after the installation you might delete your old tables or update them... The link above illustrates how you can detect if it is the first time launch or not.

Community
  • 1
  • 1
antf
  • 3,162
  • 2
  • 26
  • 33
0

Check when Opening the connection to the Database that you run CREATE TABLE IF NOT EXISTS

I have this in my database init Thus checking each time that the tables exist and if not re-create them. Then I can always drop and table and have it re-created Or When updating and adding new tables it will check also and add any new tables

BarryF
  • 77
  • 1
  • 10