Timeline rework: make sure migration doesn't crash
This commit is contained in:
parent
b370f84e08
commit
cd1da7348f
@ -344,7 +344,9 @@ internal object RealmSessionStoreMigration : RealmMigration {
|
|||||||
private fun migrateTo18(realm: DynamicRealm) {
|
private fun migrateTo18(realm: DynamicRealm) {
|
||||||
Timber.d("Step 17 -> 18")
|
Timber.d("Step 17 -> 18")
|
||||||
realm.schema.get("ChunkEntity")?.apply {
|
realm.schema.get("ChunkEntity")?.apply {
|
||||||
removeField("numberOfTimelineEvents")
|
if (hasField("numberOfTimelineEvents")) {
|
||||||
|
removeField("numberOfTimelineEvents")
|
||||||
|
}
|
||||||
var cleanOldChunks = false
|
var cleanOldChunks = false
|
||||||
if (!hasField(ChunkEntityFields.NEXT_CHUNK.`$`)) {
|
if (!hasField(ChunkEntityFields.NEXT_CHUNK.`$`)) {
|
||||||
cleanOldChunks = true
|
cleanOldChunks = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user