Add DB migration for recipient color preference.

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-07-01 12:27:25 -07:00
parent 4ea40b30a2
commit 86cf59f9a8

View File

@ -63,7 +63,8 @@ public class DatabaseFactory {
private static final int INTRODUCED_UNIQUE_PART_IDS_VERSION = 17; private static final int INTRODUCED_UNIQUE_PART_IDS_VERSION = 17;
private static final int INTRODUCED_RECIPIENT_PREFS_DB = 18; private static final int INTRODUCED_RECIPIENT_PREFS_DB = 18;
private static final int INTRODUCED_ENVELOPE_CONTENT_VERSION = 19; private static final int INTRODUCED_ENVELOPE_CONTENT_VERSION = 19;
private static final int DATABASE_VERSION = 19; private static final int INTRODUCED_COLOR_PREFERENCE_VERSION = 20;
private static final int DATABASE_VERSION = 20;
private static final String DATABASE_NAME = "messages.db"; private static final String DATABASE_NAME = "messages.db";
private static final Object lock = new Object(); private static final Object lock = new Object();
@ -742,6 +743,10 @@ public class DatabaseFactory {
db.execSQL("ALTER TABLE push ADD COLUMN content TEXT"); db.execSQL("ALTER TABLE push ADD COLUMN content TEXT");
} }
if (oldVersion < INTRODUCED_COLOR_PREFERENCE_VERSION) {
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN color TEXT DEFAULT NULL");
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
db.endTransaction(); db.endTransaction();
} }