mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-05 04:19:21 +01:00
Prepare folder ordering
This commit is contained in:
1735
app/schemas/eu.faircode.email.DB/76.json
Normal file
1735
app/schemas/eu.faircode.email.DB/76.json
Normal file
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) &&
|
||||
|
||||
Reference in New Issue
Block a user