Skip to content

Commit 9349b1a

Browse files
authored
read receipt migration added (#7640)
1 parent c9437f3 commit 9349b1a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmSessionStoreMigration.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo040
6060
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo041
6161
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo042
6262
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo043
63+
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo044
6364
import org.matrix.android.sdk.internal.util.Normalizer
6465
import org.matrix.android.sdk.internal.util.database.MatrixRealmMigration
6566
import javax.inject.Inject
@@ -68,7 +69,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
6869
private val normalizer: Normalizer
6970
) : MatrixRealmMigration(
7071
dbName = "Session",
71-
schemaVersion = 43L,
72+
schemaVersion = 44L,
7273
) {
7374
/**
7475
* Forces all RealmSessionStoreMigration instances to be equal.
@@ -121,5 +122,6 @@ internal class RealmSessionStoreMigration @Inject constructor(
121122
if (oldVersion < 41) MigrateSessionTo041(realm).perform()
122123
if (oldVersion < 42) MigrateSessionTo042(realm).perform()
123124
if (oldVersion < 43) MigrateSessionTo043(realm).perform()
125+
if (oldVersion < 44) MigrateSessionTo044(realm).perform()
124126
}
125127
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2022 The Matrix.org Foundation C.I.C.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.matrix.android.sdk.internal.database.migration
18+
19+
import io.realm.DynamicRealm
20+
import org.matrix.android.sdk.internal.database.model.ReadReceiptEntityFields
21+
import org.matrix.android.sdk.internal.util.database.RealmMigrator
22+
23+
internal class MigrateSessionTo044(realm: DynamicRealm) : RealmMigrator(realm, 44) {
24+
25+
override fun doMigrate(realm: DynamicRealm) {
26+
realm.schema.get("ReadReceiptEntity")
27+
?.addField(ReadReceiptEntityFields.THREAD_ID, String::class.java)
28+
}
29+
}

0 commit comments

Comments
 (0)