I have an APP in which I was working with a sqlite table, all right, now I add another one, I put the code but it is not generated. In the DBHelper add in the onCreate the statement to create the table with db.execSQL but when I go to the activity I get the error that the table does not exist
public class LecturasDBHelper extends SQLiteOpenHelper{
public static final int DATABASE_VERSION = 2;
public static final String DATABASE_NAME = "Lecturas.db";
public LecturasDBHelper(Context context, String nombre, SQLiteDatabase.CursorFactory factory, int version) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + Columnas.TABLE_NAME + " (" etc..
and in the activity
LecturasDBHelper reclamobd = new LecturasDBHelper(MapsActivity.this, Constantes.DB_NAME, null, Constantes.VERSION);
SQLiteDatabase db = reclamobd.getWritableDatabase();
String selectQuery1 = "SELECT * FROM " + ReclamosColumnas.ColumnasReclamos.TABLE_NAME + " WHERE " + ReclamosColumnas.ColumnasReclamos.COLUMN_NAME_TERMINADO + " = 1";
Cursor cursor1 = db.rawQuery(selectQuery1, null);
This same code works well with the previous table, but now it does not generate the new table within the same DB, is something missing?