Added upgrade statement
This commit is contained in:
parent
30674e9356
commit
02b2ec56c8
|
@ -25,7 +25,7 @@ import android.util.Log;
|
||||||
* */
|
* */
|
||||||
public class PodDBAdapter {
|
public class PodDBAdapter {
|
||||||
private static final String TAG = "PodDBAdapter";
|
private static final String TAG = "PodDBAdapter";
|
||||||
private static final int DATABASE_VERSION = 1;
|
private static final int DATABASE_VERSION = 2;
|
||||||
private static final String DATABASE_NAME = "Antennapod.db";
|
private static final String DATABASE_NAME = "Antennapod.db";
|
||||||
|
|
||||||
|
|
||||||
|
@ -598,7 +598,6 @@ public class PodDBAdapter {
|
||||||
|
|
||||||
/** Helper class for opening the Antennapod database. */
|
/** Helper class for opening the Antennapod database. */
|
||||||
private static class PodDBHelper extends SQLiteOpenHelper {
|
private static class PodDBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -632,7 +631,10 @@ public class PodDBAdapter {
|
||||||
final int newVersion) {
|
final int newVersion) {
|
||||||
Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to "
|
Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to "
|
||||||
+ newVersion + ".");
|
+ newVersion + ".");
|
||||||
// TODO delete Database
|
if (oldVersion == 1) {
|
||||||
|
db.execSQL("ALTER TABLE " + TABLE_NAME_FEEDS + " ADD COLUMN " +
|
||||||
|
KEY_TYPE + " TEXT");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue