Android的更新的SQLite数据库架构?架构、数据库、Android、SQLite

2023-09-06 04:12:03 作者:你是我过目难忘的喜欢

什么是更新数据库架构的最佳实践?我可以用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)

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