如何在Android中执行数据库模式迁移? [英] How to do database schema migrations in Android?

查看:219
本文介绍了如何在Android中执行数据库模式迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上有数据库模式迁移的标准方法吗?例如,用户安装我的Android应用程序的较新版本,但新版本需要更新数据库模式(并擦除用户的数据库,重新开始不是一个选项!)。所以我需要在第一次运行我的新版本时运行一些ALTER语句和/或复制表。

Is there a standard way to do database schema migrations on Android? For example, user installs newer version of my Android app but the new version needs to make updates to the database schema (and wiping the user's database and starting over is not an option!). So I need to run some ALTER statements and/or copy tables the first time my new version runs.

推荐答案

SQLiteOpenHelper

这篇关于如何在Android中执行数据库模式迁移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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