Override the onUpdate method of SQLiteOpenHelper and do:

if (oldVersion < VERSION_WHEN_COLUMN_ADDED)
     db.execSQL("alter table " + TABLE_NAME + " add column " +
COLUMN_NAME + " " + COLUMN_TYPE + ";");

Cheers,
Steve

On Nov 16, 8:17 am, "jagtap.jj" <[email protected]> wrote:
> Hello everybody
>
> Is there way for Android or in SQLite to preserve old version Db table
> columns, while adding new table columns for new version.
>
> The new application version should not vanish all user data from old
> version.
>
> Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to