You know, when i first create table, i don't make it perfect. now, i
want to modify table structure and keep the old data stay. how to do
it?
i can't remove table and create table it. it will clear all data?
private static final String DATABASE_CREATE =
"create table notes (_id integer primary key
autoincrement, "
+ "title text not null, body text not null);";
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
db.execSQL("DROP TABLE IF EXISTS notes");
onCreate(db);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---