简体   繁体   English

如何通过Asset文件夹在Android中手动实现Sqlite数据库升级?

[英]How to achieve Sqlite data base up-gradation manually in Android through asset folder?

I want to make db version control for Sqlite .db file which is inside my asset folder Manually without Google play app store. 我想对Sqlite .db文件进行数据库版本控制,该文件位于我的资产文件夹内,而无需Google Play应用商店即可手动进行。 (as its custom app for user). (作为用户的自定义应用)。 First deployment I have db version 1.00 after that Second deployment I have version 1.01 with some DB file changes for column name or type changes in certain table. 第一次部署后,我的数据库版本为1.00,第二次部署时,我的数据库版本为1.01,列名称或某些表的类型更改了一些数据库文件。

How can i achieve without uninstalling db from installed app. 如何在不从已安装的应用程序中卸载数据库的情况下实现。 just replacing existing DB for particular column? 只是替换特定列的现有数据库?

Also don't want to loose users data.(as there are some master tables). 也不想丢失用户数据。(因为有一些主表)。

please see this answer too . 请也看到这个答案。

Question1 问题1

Question2 问题2

您需要对所有表执行SELECT * FROM TABLE_NAME类的请求,并将获取的数据以字符串形式保存在任何文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM