Questions tagged [realm-migration]

Realm is a databasing system for iOS and Android mobile applications. Then a change is made in the database model it must be "Migrated" to the 'realm' for it to be incorporated into the database scheme.

Realm is a databasing system for iOS and Android mobile applications. When a change is made in the database model it must be "Migrated" to the 'realm' for it to be incorporated into the database scheme.

For information:
https://realm.io/docs/swift/latest/#migrations
https://realm.io/docs/swift/latest/api/

207 questions
5
votes
0 answers

Migration on Realm 0.81.1

Got different exception after adding objects. migration needed class not found in scheme version on disk is newer than requested What is wrong? 1 - MainActivity.java RealmConfiguration realmConfiguration = new…
5
votes
3 answers

Detect if Realm.io db needs migration - if so, destroy it

I'm using Realm for caching over the not-so-long term, and have no need to keep up with schema versions or migrating any time there's a change to a data model. So, instead of crashing anytime there's a change to the data model, how can my app…
iantheparker
  • 239
  • 3
  • 11
4
votes
2 answers

io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors: - Class 'SaveMessage' has been added

I am developing new app but I am getting following exception java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MessengerActivity}: …
Sweden Edgar
  • 2,039
  • 2
  • 8
  • 8
4
votes
2 answers

Realm migration from a required variable to nullable

Realm migration from a required variable to nullable I had a variable which was a REQUIRED field in my previous version of realm. But for the newer version i want it to be not required but a nullable one. How do i do it through realm migration?
Ankur
  • 677
  • 1
  • 7
  • 21
4
votes
1 answer

RealmMigrationNeededException when adding RealmList (Kotlin)

I want to add a primitive list to an existing model but I get an exception. Attention: This is all done it Kotlin. Here's the model: open class Foo( @PrimaryKey var id: Int = 0 ) : RealmObject() Now I want to add the following field: var…
hardysim
  • 2,756
  • 2
  • 25
  • 52
4
votes
1 answer

RealmMigrationNeededException while

I have a live app which uses a previous version of realm(v0.85.1), I'm working on a new release which uses version 4.2.0 of realm and also has a schema change. The schema change is just a single column added to one table. For the Migration I have…
Oyebisi
  • 562
  • 2
  • 9
  • 23
4
votes
0 answers

Realm migration is crashing on Android 7.1.2

The app is crashing with a realm exception that some tables do not exist in the schema. I made three tables in Realm Database and created the migration for it. The app update(migration) is working for all versions of Android, but for Android 7.1.2…
4
votes
0 answers

Primary key property has duplicate values after migration - Realm migration

I have an existing Realm project with two models Model1 -> id, updateDate, details Model2 -> id, updateDate, title, model1 (yes I used a class object instead of the id - aargh. Both id are primary keys) With an updated version of my app, I am…
lostInTransit
  • 70,519
  • 61
  • 198
  • 274
4
votes
1 answer

How to add a field to the schema of a Realm database?

I am seeking to add another property to my Realm database scheme (pointed to by the arrow) while at the same time learn how to use the migration functionality. class FeesPaid: Object { dynamic var fileNumber = "" dynamic var forMonth = "" …
Delete My Account
  • 745
  • 2
  • 9
  • 21
4
votes
2 answers

Perform migration by adding List() and another model class

I have the following models class Area: Object { // Specify properties to ignore (Realm won't persist these) // override static func ignoredProperties() -> [String] { // return [] // } dynamic var id = 0 dynamic var name = "" …
Happiehappie
  • 1,084
  • 2
  • 13
  • 26
4
votes
1 answer

Could not cast value of type 'RealmSwift.DynamicObject' to MyCustomObject during migration

During RealmSwift migration, i want to migrate from dynamic var customObject: CustomObject to let customObjectList = List(). CustomObject is type of Object This is the chunk of code within migration let newList =…
perwyl
  • 323
  • 3
  • 14
4
votes
2 answers

Android Realm Migration version number based on what?

I'm doing my first Realm migration and started thinking about the version number. On what is this version number based? Because if it is based on what is on your phone, how do I handle it if a new person installs the app and gets a migration?…
Kevin van Mierlo
  • 9,554
  • 5
  • 44
  • 76
3
votes
2 answers

how can i Migrate Realm without losing any data - Kotlin

I've been trying to rename field or add new field to my realm database. But i'm getting error like this. I tried to debug my app it looks like oldVersion++ is not increasing the old schema version. Detailed Error is down below Any help would be…
3
votes
2 answers

realm migration error "Property 'x' has been added"

i can't use migration realm in my project, you need to configure the migration of realm. I created a migration class,I added migration and added field to realmObject but don't work migration i get this error message : Migration is required due to…
Kourosh
  • 2,239
  • 13
  • 18
3
votes
1 answer

RealmMigrationNeededException when PrimaryKey is added/removed

Here is Code of my Realm Configuration. Issue is, When I remove or add any PrimaryKey I'm getting RealmMigrationNeededException exception. previsoly UpgradeInfo.class, RealmApplication.class public class UpgradeInfo extends RealmObject{ …
martin
  • 31
  • 5
1
2
3
13 14