应用更新时,不要替换旧数据库 [英] Don't wan't to replacing the old database when app is updated

查看:155
本文介绍了应用更新时,不要替换旧数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用sqlite数据库
当应用商店中更新应用时,我不想替换现有的数据库。

In my app I am using sqlite database I don't want to replace an existing database when app is updated in app store.

替换为新数据库?

推荐答案

@Ankit:Hi ..

@Ankit: Hi..

答案是,它将不会替换数据库,它将保持相同的旧数据库的用户谁使用以前的版本的应用程序,然后他们只是下载并安装新版本的应用程序不删除以前的版本。

Answer is NO it will not replace the database it will remain the same old database for the users who are aready using previous version of your app and then they just download and install the new version of the app without deleting the previous version.

它将替换App Store上的数据库,但它不会替换数据库默认情况下,如果用户使用以前的版本如果数据库已存在,则它不会替换数据库过程

It will replace database on App Store but it does not replace the database by default if the user is using previous version of your app. If database already exists then it does not replace the database procedure

我们必须进行数据库升级过程在我们必须检查数据库中的某些标志或版本号(如果提供),并基于我们必须创建数据库升级过程。

We have to make a database upgrade procedure where in we have to check some flag or the version number in database if provided and based on that we have to create a database upgrade procedure.

您必须使用数据库升级过程对数据库进行更改,并对现有表进行更改,例如添加或删除列,或者可能正在更改表的结构使用SQL查询

You have to make the changes in database using database upgrade procedure and make alterations into existing tables such as adding or deleting a column or may be changing the structure of the table using SQL Queries.

然后您必须最终更新数据库中的版本号或某些标志,这样才能知道数据库已经升级,因此每次应用程序加载时不应运行相同的过程

Then you have to finally update the version number or some flag in the database which would let it know that the database is already upgraded so it should not run the same procedure every time when application loads.

同样重要的是,用户已经存储在他/她的数据库中的数据。不应删除。

如果您需要更多帮助,请随时与我联系。

Feel free to contact me if you need more help.

希望这有助于。

这篇关于应用更新时,不要替换旧数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆