mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Upgrade Realm to version 10.4.0
Migration with isEmbedded tested OK
This commit is contained in:
parent
fb0205e903
commit
20f86a30e8
@ -34,6 +34,7 @@ SDK API changes ⚠️:
|
||||
Build 🧱:
|
||||
- Upgrade to gradle 7
|
||||
- https://github.com/Piasy/BigImageViewer is now hosted on mavenCentral()
|
||||
- Upgrade Realm to version 10.4.0
|
||||
|
||||
Test:
|
||||
-
|
||||
|
@ -6,13 +6,10 @@ apply plugin: 'realm-android'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
// mavenCentral()
|
||||
//noinspection GrDeprecatedAPIUsage
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
// Stick to this version until https://github.com/realm/realm-java/issues/7402 is fixed
|
||||
classpath "io.realm:realm-gradle-plugin:10.3.1"
|
||||
classpath "io.realm:realm-gradle-plugin:10.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,10 +144,6 @@ class RealmSessionStoreMigration @Inject constructor() : RealmMigration {
|
||||
Timber.d("Step 7 -> 8")
|
||||
|
||||
val editionOfEventSchema = realm.schema.create("EditionOfEvent")
|
||||
.apply {
|
||||
// setEmbedded does not return `this`...
|
||||
isEmbedded = true
|
||||
}
|
||||
.addField(EditionOfEventFields.CONTENT, String::class.java)
|
||||
.addField(EditionOfEventFields.EVENT_ID, String::class.java)
|
||||
.setRequired(EditionOfEventFields.EVENT_ID, true)
|
||||
@ -162,6 +158,10 @@ class RealmSessionStoreMigration @Inject constructor() : RealmMigration {
|
||||
?.removeField("lastEditTs")
|
||||
?.removeField("sourceLocalEchoEvents")
|
||||
?.addRealmListField(EditAggregatedSummaryEntityFields.EDITIONS.`$`, editionOfEventSchema)
|
||||
|
||||
// This has to be done once a parent use the model as a child
|
||||
// See https://github.com/realm/realm-java/issues/7402
|
||||
editionOfEventSchema.isEmbedded = true
|
||||
}
|
||||
|
||||
private fun migrateTo9(realm: DynamicRealm) {
|
||||
|
Loading…
Reference in New Issue
Block a user