Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to update SQLite database in App store/Play store?


This question is answered.


Permlink Replies: 3 - Last Post: Sep 7, 2015 2:03 AM Last Post By: Benjamin Cabot
Remi Arts

Posts: 40
Registered: 11/15/13
How to update SQLite database in App store/Play store?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 25, 2015 6:53 AM
I add my database in project deployement as a file. But i've noticed when I update my database with a new table, new colomns or new inserts it doesn't update the database in the app stays as the old database. If i than delete the data of the app trough settings i get the new database or delete the app and reinstall it.

I want to update the database without losing any data already inside the database. How do I do this?
Benjamin Cabot

Posts: 25
Registered: 4/21/13
Re: How to update SQLite database in App store/Play store?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 4, 2015 3:06 AM   in response to: Remi Arts in response to: Remi Arts
Remi Arts wrote:
I add my database in project deployement as a file. But i've noticed when I update my database with a new table, new colomns or new inserts it doesn't update the database in the app stays as the old database. If i than delete the data of the app trough settings i get the new database or delete the app and reinstall it.

I want to update the database without losing any data already inside the database. How do I do this?

1 - Put a database version number in a .ini file

2 - Check database version number at application startup

3 - If necessary, execute SQL code (into the application) to update database structure and increment .ini db version number

This is how I manage it….successfully.
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: How to update SQLite database in App store/Play store?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 4, 2015 1:13 PM   in response to: Remi Arts in response to: Remi Arts
What do you mean "update my database"?
You mean when you install a new test app from Delphi IDE? If you put the file in the Documents directory, Delphi is supposed to leave it alone and not overwrite it the next time.

If the app is updated from the app store the update will leave files in The Documents directory alone too.

You could try finding some other directory to put the file in that WILL get overwritten each time.
Benjamin Cabot

Posts: 25
Registered: 4/21/13
Re: How to update SQLite database in App store/Play store?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2015 2:03 AM   in response to: Douglas Rudd in response to: Douglas Rudd
Douglas Rudd wrote:
What do you mean "update my database"?
You mean when you install a new test app from Delphi IDE? If you put the file in the Documents directory, Delphi is supposed to leave it alone and not overwrite it the next time.

If the app is updated from the app store the update will leave files in The Documents directory alone too.

You could try finding some other directory to put the file in that WILL get overwritten each time.

With this solution you will lose previous data at each update....
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02