Fix crash in Realm migration

This commit is contained in:
Benoit Marty 2020-12-14 14:33:47 +01:00
parent b31dfcfe4f
commit db0a958708

View File

@ -35,5 +35,7 @@ internal object GlobalRealmMigration : RealmMigration {
private fun migrateTo1(realm: DynamicRealm) { private fun migrateTo1(realm: DynamicRealm) {
realm.schema.create("KnownServerUrlEntity") realm.schema.create("KnownServerUrlEntity")
.addField(KnownServerUrlEntityFields.URL, String::class.java) .addField(KnownServerUrlEntityFields.URL, String::class.java)
.addPrimaryKey(KnownServerUrlEntityFields.URL)
.setRequired(KnownServerUrlEntityFields.URL, true)
} }
} }