Added folder modseq

pull/197/head
M66B 4 years ago
parent 7076e9a9a7
commit f0fd4343ba

File diff suppressed because it is too large Load Diff

@ -65,7 +65,7 @@ import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_PASSWORD;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 191,
version = 192,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -1967,6 +1967,13 @@ public abstract class DB extends RoomDatabase {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `folder` ADD COLUMN `selected_last` INTEGER NOT NULL DEFAULT 0");
}
})
.addMigrations(new Migration(191, 192) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `folder` ADD COLUMN `modseq` INTEGER");
}
});
}

@ -344,6 +344,9 @@ public interface DaoFolder {
@Query("UPDATE folder SET uidv = :uidv WHERE id = :id AND NOT (uidv IS :uidv)")
int setFolderUidValidity(long id, Long uidv);
@Query("UPDATE folder SET modseq = :modseq WHERE id = :id AND NOT (modseq IS :modseq)")
int setFolderModSeq(long id, Long modseq);
@Query("UPDATE folder SET last_sync = :last_sync WHERE id = :id AND NOT (last_sync IS :last_sync)")
int setFolderLastSync(long id, long last_sync);

@ -71,6 +71,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
public Long account; // Outbox = null
public Long parent;
public Long uidv; // UIDValidity
public Long modseq;
@NonNull
public String name;
@NonNull

Loading…
Cancel
Save