I have a database with 4 columns:
@Override
public void onCreate(SQLiteDatabase database) {
database.execSQL(\"CREATE TABLE \" + DATABASENAME + \" (name
Please see this page for the syntax to create a new column on a table. Basically it is:
ALTER TABLE mytable ADD COLUMN mycolumn TEXT
In your onUpgrade method, it would look something like this:
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
String upgradeQuery = "ALTER TABLE mytable ADD COLUMN mycolumn TEXT";
if (oldVersion == 1 && newVersion == 2)
db.execSQL(upgradeQuery);
}