Added pushed_at column to other remote models

pull/14/head
Sam Bosley 12 years ago
parent c01f2f45dd
commit a4df5a2580

@ -105,6 +105,10 @@ public class Update extends RemoteModel {
public static final StringProperty PROOF_TEXT = new StringProperty( public static final StringProperty PROOF_TEXT = new StringProperty(
TABLE, PROOF_TEXT_PROPERTY_NAME); TABLE, PROOF_TEXT_PROPERTY_NAME);
/** Pushed at date */
public static final LongProperty PUSHED_AT = new LongProperty(
TABLE, PUSHED_AT_PROPERTY_NAME);
/** List of all properties for this model */ /** List of all properties for this model */
public static final Property<?>[] PROPERTIES = generateProperties(Update.class); public static final Property<?>[] PROPERTIES = generateProperties(Update.class);
@ -137,6 +141,7 @@ public class Update extends RemoteModel {
defaultValues.put(MESSAGE.name, ""); defaultValues.put(MESSAGE.name, "");
defaultValues.put(TARGET_NAME.name, ""); defaultValues.put(TARGET_NAME.name, "");
defaultValues.put(PICTURE.name, ""); defaultValues.put(PICTURE.name, "");
defaultValues.put(PUSHED_AT.name, 0L);
} }
// --- data access boilerplate // --- data access boilerplate

@ -58,6 +58,10 @@ public final class User extends RemoteModel {
public static final LongProperty REMOTE_ID = new LongProperty( public static final LongProperty REMOTE_ID = new LongProperty(
TABLE, REMOTE_ID_PROPERTY_NAME); TABLE, REMOTE_ID_PROPERTY_NAME);
/** Pushed at date */
public static final LongProperty PUSHED_AT = new LongProperty(
TABLE, PUSHED_AT_PROPERTY_NAME);
/** List of all properties for this model */ /** List of all properties for this model */
public static final Property<?>[] PROPERTIES = generateProperties(User.class); public static final Property<?>[] PROPERTIES = generateProperties(User.class);
@ -70,6 +74,7 @@ public final class User extends RemoteModel {
defaultValues.put(NAME.name, ""); defaultValues.put(NAME.name, "");
defaultValues.put(EMAIL.name, ""); defaultValues.put(EMAIL.name, "");
defaultValues.put(PICTURE.name, ""); defaultValues.put(PICTURE.name, "");
defaultValues.put(PUSHED_AT.name, 0L);
} }
@Override @Override

@ -345,6 +345,8 @@ public class Database extends AbstractDatabase {
database.execSQL(addColumnSql(Metadata.TABLE, Metadata.DELETION_DATE, visitor, "0")); database.execSQL(addColumnSql(Metadata.TABLE, Metadata.DELETION_DATE, visitor, "0"));
database.execSQL(addColumnSql(Task.TABLE, Task.PUSHED_AT, visitor, null)); database.execSQL(addColumnSql(Task.TABLE, Task.PUSHED_AT, visitor, null));
database.execSQL(addColumnSql(TagData.TABLE, TagData.PUSHED_AT, visitor, null)); database.execSQL(addColumnSql(TagData.TABLE, TagData.PUSHED_AT, visitor, null));
database.execSQL(addColumnSql(User.TABLE, User.PUSHED_AT, visitor, null));
database.execSQL(addColumnSql(Update.TABLE, Update.PUSHED_AT, visitor, null));
} catch (SQLiteException e) { } catch (SQLiteException e) {
Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e); Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
} }

Loading…
Cancel
Save