Android的更新的SQLite数据库架构? [英] Android update SQLite DB schema?

查看:153
本文介绍了Android的更新的SQLite数据库架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是更新数据库架构的最佳实践?我可以用SQL命令发送一个文本文件。该应用程序可以检查该文本文件并执行所需的命令。我猜,我将有一个标志,表明该更新已经完成。我还没有找到一个方法来删除一个文件从应用程序,这将是后做数据库进行了更新,最好的东西的资源文件夹。

What is the best practice for updating the DB schema? I could send a text file with the SQL commands. The app could check the text file and execute the commands needed. I am guessing then I will have a flag to indicate that the update has been done. I havent found a way to delete a file in the asset folder from the app, which would be the best thing to do after the DB was updated.

在这个有什么想法?

推荐答案

您可能要重写

onUpdate(SQLiteDatabase db,int old Version,int newVerison)

下面的教程可引导您完成整个过程:<一href="http://www.$c$cproject.com/KB/android/AndroidSQLite.aspx">http://www.$c$cproject.com/KB/android/AndroidSQLite.aspx

这篇关于Android的更新的SQLite数据库架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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