简体   繁体   English

在android中升级应用程序版本时如何管理数据库更改?

[英]How to manage database changes while upgrading application versions in android?

With every upgrade there is some change in database schema? 每次升级时,数据库架构都会有所变化吗? The change could alteration of column types or addition/deletion of columns. 更改可能会更改列类型或添加/删除列。

This forces a reinstall of app ie., uninstall older version and then download app again from the android market. 这会强制重新安装应用程序,即卸载旧版本,然后再次从android市场下载应用程序。

Is there a best practice to follow so that old data is copied during app installation and reinitialized with newer schemas? 是否有最佳实践可遵循,以便在应用程序安装期间复制旧数据并使用较新的架构重新初始化?

在SqliteOpenHelper的实现中重写方法onUpgrade()

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

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