在sqliteopenhelper onupgrade上管理sqlite表 [英] Manage sqlite tables on sqliteopenhelper onupgrade

查看:73
本文介绍了在sqliteopenhelper onupgrade上管理sqlite表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Playstore中发布了一个Android应用程序。我需要在现有表中添加一些列。当我删除并重新创建表格时,所有数据都将丢失。



有没有办法改变数据库保留现有数据。



我尝试了什么:



更改表添加列如果不是EXISTS似乎没有帮助我。

I have an android app published in Playstore. I need to add some columns to the existing table. When I drop and recreate the table, all data will be lost.

Is there any way to alter the database keeping existing data.

What I have tried:

ALTER TABLE ADD COLUMN IF NOT EXISTS doesn't seem to be helping me.

推荐答案

SQLite查询语言:ALTER TABLE [ ^ ]


这篇关于在sqliteopenhelper onupgrade上管理sqlite表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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