我正在尝试更新我的数据库以拥有另一个名为 Visible 的列。我希望整个列都填充错误值。当我运行代码时,它会进入更新函数并抛出以下错误:
android.database.sqlite.SQLiteException: no such column: true: UPDATE Themes2 SET Visibility = true;
private static final String TABLE_THEMES_V2 = "Themes2";
public static final String KEY_VISIBLE = "Visibility";
if (oldVersion < 8) {
db.execSQL("ALTER TABLE " + TABLE_THEMES_V2 + " ADD COLUMN " + KEY_VISIBLE + " text");
db.execSQL("UPDATE " + TABLE_THEMES_V2 + " SET " + KEY_VISIBLE + " = true;");
db.setTransactionSuccessful();
}
有谁知道出了什么问题?很久以前我使用相同的功能在列中输入“1”......