I have an application running with a working table called ANIMAL. Upon first creating this table it consisted simply of _id and animal_name columns.
Now I am trying to expand on it, including a animal_biography column, however I am having a little difficulty.At first I thought I was just a case of upgrading my CREATE_TABLE statement to include the animal bio:
private static final String DATABASE_CREATE =
"create table " + ANIMALS_TABLE +
" (_id integer primary key autoincrement, " +
"animal_name text not null, " +
"biography text not null);";
however, looking at the logcat it tells me the column biography does not exist when trying to insert into it.
Now, I have tried to upgrade the database by using the onUpgrade()
and including the code
db.execSQL("ALTER TABLE" + DATABASE_NAME);
db.execSQL(DATABASE_CREATE);
but this is not solving the problem either. Does anyone have any pointers on how to go about fixing this problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…