Prepare folder ordering

pull/156/head
M66B 5 years ago
parent c42c8d9bea
commit 204c2418a2

File diff suppressed because it is too large Load Diff

@ -51,7 +51,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 75,
version = 76,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -773,6 +773,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `folder` ADD COLUMN `navigation` INTEGER NOT NULL DEFAULT 0");
}
})
.addMigrations(new Migration(75, 76) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `folder` ADD COLUMN `order` INTEGER");
}
})
.build();
}

@ -176,6 +176,9 @@ public interface DaoFolder {
@Query("UPDATE folder SET display = :display WHERE id = :id")
int setFolderDisplay(long id, String display);
@Query("UPDATE folder SET `order` = :order WHERE id = :id")
int setFolderOrder(long id, Integer order);
@Query("UPDATE folder SET parent = :parent WHERE id = :id")
int setFolderParent(long id, Long parent);

@ -84,6 +84,7 @@ public class EntityFolder implements Serializable {
@NonNull
public Integer keep_days;
public String display;
public Integer order;
@NonNull
public Boolean hide = false;
@NonNull
@ -278,12 +279,14 @@ public class EntityFolder implements Serializable {
this.sync_days.equals(other.sync_days) &&
this.keep_days.equals(other.keep_days) &&
Objects.equals(this.display, other.display) &&
Objects.equals(this.order, other.order) &&
this.hide == other.hide &&
this.collapsed == other.collapsed &&
this.unified == other.unified &&
this.notify == other.notify &&
Objects.equals(this.total, other.total) &&
Helper.equal(this.keywords, other.keywords) &&
Objects.equals(this.tbc, other.tbc) &&
Objects.equals(this.tbd, other.tbd) &&
Objects.equals(this.state, other.state) &&
Objects.equals(this.sync_state, other.sync_state) &&

Loading…
Cancel
Save