开发者

modifying SQLite schema

开发者 https://www.devze.com 2023-03-21 00:39 出处:网络
I have a SQLite db I include in the assets folder. I installed the app on a device. I understand it gets copied into memory and everything works OK.

I have a SQLite db I include in the assets folder. I installed the app on a device. I understand it gets copied into memory and everything works OK.

Now I changed the structure of a table in the SQLite db using the SQL Browser. So I replaced the one in the assets folder with the new one and incremented my app version number.

From reading questions I understand that when I upgrade the app on a device the "onUpgrade" will be called and it seems I must first delete the previous SQL db, since it's not the correct structure.

开发者_C百科Do I just delete the older version when "onUpgrage" is called and then do what?


Its better to uninstall your previous application and install the new one with changed database structrue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号