I have an question.
I have only one table in my database
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL( "CREATE TABLE books (_id INTEGER PRIMARY KEY AUTOINCREMENT,title TEXT, author TEXT,isbn TEXT,city TEXT);");
Log.v("onCreate-------","called onCreate");
}
here:-
sqlite> select * from books;
also working fine.
but i want to add new table so i am trying to add here :-
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
android.util.Log.w("books",
"Upgrading database, which will destroy all old data");
//db.execSQL("ALTER TABLE myallbooks ADD COLUMN city2");
db.execSQL("CREATE TABLE myfields (author TEXT,isbn TEXT,city TEXT);");
Log.v("onUpgrade-------","called onUpgrade with alter");
}
after changing the version number i run the app but i did not found the table any where.
sqlite> select * from myfields;
Error:-no such table :myfield.
..................why it is not creating