mirror of https://github.com/M66B/FairEmail.git
Added index on subject, cleanup
This commit is contained in:
parent
f9a41cfce5
commit
83f6150d24
File diff suppressed because it is too large
Load Diff
|
@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
|
||||||
// https://developer.android.com/topic/libraries/architecture/room.html
|
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||||
|
|
||||||
@Database(
|
@Database(
|
||||||
version = 49,
|
version = 50,
|
||||||
entities = {
|
entities = {
|
||||||
EntityIdentity.class,
|
EntityIdentity.class,
|
||||||
EntityAccount.class,
|
EntityAccount.class,
|
||||||
|
@ -234,7 +234,7 @@ public abstract class DB extends RoomDatabase {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(SupportSQLiteDatabase db) {
|
public void migrate(SupportSQLiteDatabase db) {
|
||||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||||
db.execSQL("CREATE INDEX `index_message_ui_flagged` ON `message` (`ui_flagged`)");
|
db.execSQL("CREATE INDEX `index_message_ui_flagged` ON `message` (`ui_flagged`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addMigrations(new Migration(13, 14) {
|
.addMigrations(new Migration(13, 14) {
|
||||||
|
@ -345,7 +345,7 @@ public abstract class DB extends RoomDatabase {
|
||||||
public void migrate(SupportSQLiteDatabase db) {
|
public void migrate(SupportSQLiteDatabase db) {
|
||||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||||
db.execSQL("ALTER TABLE `message` ADD COLUMN `sender` TEXT");
|
db.execSQL("ALTER TABLE `message` ADD COLUMN `sender` TEXT");
|
||||||
db.execSQL("CREATE INDEX `index_message_sender` ON `message` (`sender`)");
|
db.execSQL("CREATE INDEX `index_message_sender` ON `message` (`sender`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addMigrations(new Migration(27, 28) {
|
.addMigrations(new Migration(27, 28) {
|
||||||
|
@ -397,7 +397,7 @@ public abstract class DB extends RoomDatabase {
|
||||||
public void migrate(SupportSQLiteDatabase db) {
|
public void migrate(SupportSQLiteDatabase db) {
|
||||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||||
db.execSQL("ALTER TABLE `message` ADD COLUMN `ui_snoozed` INTEGER");
|
db.execSQL("ALTER TABLE `message` ADD COLUMN `ui_snoozed` INTEGER");
|
||||||
db.execSQL("CREATE INDEX `index_message_ui_snoozed` ON `message` (`ui_snoozed`)");
|
db.execSQL("CREATE INDEX `index_message_ui_snoozed` ON `message` (`ui_snoozed`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addMigrations(new Migration(32, 33) {
|
.addMigrations(new Migration(32, 33) {
|
||||||
|
@ -442,8 +442,8 @@ public abstract class DB extends RoomDatabase {
|
||||||
" `condition` TEXT NOT NULL," +
|
" `condition` TEXT NOT NULL," +
|
||||||
" `action` TEXT NOT NULL," +
|
" `action` TEXT NOT NULL," +
|
||||||
" FOREIGN KEY(`folder`) REFERENCES `folder`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE)");
|
" FOREIGN KEY(`folder`) REFERENCES `folder`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE)");
|
||||||
db.execSQL("CREATE INDEX `index_rule_folder` ON `rule` (`folder`)");
|
db.execSQL("CREATE INDEX `index_rule_folder` ON `rule` (`folder`)");
|
||||||
db.execSQL("CREATE INDEX `index_rule_order` ON `rule` (`order`)");
|
db.execSQL("CREATE INDEX `index_rule_order` ON `rule` (`order`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addMigrations(new Migration(37, 38) {
|
.addMigrations(new Migration(37, 38) {
|
||||||
|
@ -499,7 +499,7 @@ public abstract class DB extends RoomDatabase {
|
||||||
", `email` TEXT NOT NULL" +
|
", `email` TEXT NOT NULL" +
|
||||||
", `name` TEXT)");
|
", `name` TEXT)");
|
||||||
db.execSQL("CREATE UNIQUE INDEX `index_contact_email_type` ON `contact` (`email`, `type`)");
|
db.execSQL("CREATE UNIQUE INDEX `index_contact_email_type` ON `contact` (`email`, `type`)");
|
||||||
db.execSQL("CREATE INDEX `index_contact_name_type` ON `contact` (`name`, `type`)");
|
db.execSQL("CREATE INDEX `index_contact_name_type` ON `contact` (`name`, `type`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addMigrations(new Migration(44, 45) {
|
.addMigrations(new Migration(44, 45) {
|
||||||
|
@ -534,7 +534,16 @@ public abstract class DB extends RoomDatabase {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(SupportSQLiteDatabase db) {
|
public void migrate(SupportSQLiteDatabase db) {
|
||||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||||
db.execSQL("CREATE INDEX `index_operation_name` ON `operation` (`name`)");
|
db.execSQL("CREATE INDEX `index_operation_name` ON `operation` (`name`)");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.addMigrations(new Migration(49, 50) {
|
||||||
|
@Override
|
||||||
|
public void migrate(SupportSQLiteDatabase db) {
|
||||||
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||||
|
db.execSQL("DROP INDEX `index_message_replying`");
|
||||||
|
db.execSQL("DROP INDEX `index_message_forwarding`");
|
||||||
|
db.execSQL("CREATE INDEX `index_message_subject` ON `message` (`subject`)");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -57,13 +57,12 @@ import static androidx.room.ForeignKey.SET_NULL;
|
||||||
@Index(value = {"account"}),
|
@Index(value = {"account"}),
|
||||||
@Index(value = {"folder"}),
|
@Index(value = {"folder"}),
|
||||||
@Index(value = {"identity"}),
|
@Index(value = {"identity"}),
|
||||||
@Index(value = {"replying"}),
|
|
||||||
@Index(value = {"forwarding"}),
|
|
||||||
@Index(value = {"folder", "uid"}, unique = true),
|
@Index(value = {"folder", "uid"}, unique = true),
|
||||||
@Index(value = {"msgid", "folder"}, unique = true),
|
@Index(value = {"msgid", "folder"}, unique = true),
|
||||||
@Index(value = {"thread"}),
|
@Index(value = {"thread"}),
|
||||||
@Index(value = {"sender"}),
|
@Index(value = {"sender"}),
|
||||||
@Index(value = {"received"}),
|
@Index(value = {"received"}),
|
||||||
|
@Index(value = {"subject"}),
|
||||||
@Index(value = {"ui_seen"}),
|
@Index(value = {"ui_seen"}),
|
||||||
@Index(value = {"ui_flagged"}),
|
@Index(value = {"ui_flagged"}),
|
||||||
@Index(value = {"ui_hide"}),
|
@Index(value = {"ui_hide"}),
|
||||||
|
|
Loading…
Reference in New Issue