在我之前的应用程序版本中,我创建了一个表格,如下所示:
public static final String CREATE_DATABASE = "CREATE TABLE " + TABLE_NAME
+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_NAME_TITLE + " TEXT, "
+ COLUMN_NAME_LOGIN + " TEXT, " + COLUMN_NAME_PASSWORD + " TEXT, " + COLUMN_NAME_NOTES
+ " TEXT);";
在当前版本中,我创建了一个表,如下所示:
public static final String CREATE_DATABASE = "CREATE VIRTUAL TABLE " + TABLE_NAME + " USING fts3 "
+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_NAME_TITLE + " TEXT, "
+ COLUMN_NAME_LOGIN + " TEXT, " + COLUMN_NAME_PASSWORD + " TEXT, " + COLUMN_NAME_NOTES
+ " TEXT, " + COLUMN_NAME_FAV + " INTEGER DEFAULT 0, " + KEY_WORD + ");";
所以现在是VIRTUAL
,创建USING fts3
并添加了两个新列COLUMN_NAME_FAV
和KEY_WORD
.
升级时有可能以某种方式改变表吗?如果没有,我应该怎么做才能让用户不会丢失他们的数据?