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
0
votes
1 answer

How to support multiple RealmMigrations

We have multiple android libraries that are independent to each other & relies on core library. Core library has CoreRealmManager, which is responsible for all realm operations. app | --- lib-module-a | \-- lib-module-c | \--…
VenomVendor
  • 15,064
  • 13
  • 65
  • 96
0
votes
1 answer

Maintain Realm data migration for only specific table

I want to use Realm migration to maintain data for only one table. Like for example here, I want to maintain data for Profile User table and delete all the rest of the table. Here is what I have done so far. But everything in the database gets…
viper
  • 1,836
  • 4
  • 25
  • 41
0
votes
2 answers

Android Realm migrating from 1.x to 2.x

We're trying to migrate Realm from 1.x to a 2.x version. Do we need to provide migration in this case? We would like to keep the data obviously, but I think Realm deletes it if you update the app now. We havent released the 2.x version yet so now we…
breakline
  • 5,776
  • 8
  • 45
  • 84
0
votes
1 answer

Realm included in bundle doesn't migrate

I have created a Realm database with the data I needed at the moment, but I need to add two properties to an entity. Therefore, I just added those two properties to my entity. I expected a crash, because of pending migrations, so I created an extra…
jbehrens94
  • 2,356
  • 6
  • 31
  • 59
0
votes
1 answer

Logout user on wrong encryption key in Realm

I am using a Realm database in my Android App. The data needs to be encrypted and I am using Realm's encryption. They key is coming from server and then is stored on device, but is encrypted using user PIN. I want to logout user if - by any means -…
0
votes
1 answer

io.realm.exceptions.RealmMigrationNeededException: The 'ImportantCalls' class is missing from the schema for this Realm?

I am facing the issue in realm migration. I want to add the new model class in a realm database. Please help me how to solve this. public class Migration implements RealmMigration { @Override public void migrate(DynamicRealm realm, long…
Prabha Karan
  • 1,309
  • 3
  • 17
  • 35
0
votes
1 answer

Primary key update in Realm migration

I have several cases where I have to update some object models, including the property that I use as a primary key. For example : Merge the primary key name (e.g. Georges, Anna...), and the familyName (e.g. Johnson, Smith...) property, and use that…
Yoam Farges
  • 773
  • 4
  • 16
0
votes
1 answer

Migration of Realm for Android: how to addRealmListField correctly

In the previous RealmDB, I have Program table like: public class Program extends RealmObject { @Expose @SerializedName("episodes") @ParcelPropertyConverter(RealmListParcelConverter.class) public RealmList episodes; …
Cuong Nguyen
  • 1,166
  • 1
  • 11
  • 20
0
votes
0 answers

Realm migration using assetFile()

I've followed the instructions on migration at Realm's website and use assetFile() in my Realm configuration. Yet it appears the migrated realm is empty as any query returns zero items, when it should return at least one. Many examples with…
mraviator
  • 4,034
  • 9
  • 38
  • 51
0
votes
1 answer

iOS Swift Storing Alamofire Response To Realm

I need to store alamofire JSON response to realm storage directly. Here is the response tat I get from alamofire JSON. { "all": [ { "date": "2017-03-30T00:00:00.000Z", "subject": "loe", "desc": "", "id": 13, …
Kavin Kumar Arumugam
  • 1,792
  • 3
  • 28
  • 47
0
votes
1 answer

Android : Realm Migration Issue

I am new to android and I used realm in my APP but I didn't specified the schemaversion then, now when I want to upgrade the app and implement migration. Previously, I was doing this, Realm.init(getApplicationContext()); RealmConfiguration…
Mayank
  • 259
  • 2
  • 16
0
votes
1 answer

Xamarin Realm Migration API/Method/Interface to add/update/delete schema?

Is there any API/Method/Interface to add/update/delete schema for Real Xamarin? Scenarios: Update existing class property to make it primary key. Delete existing class property (Primary or normal). Add a new property in existing class. Add new…
0
votes
1 answer

RLMArray to RLMLinkingObjects migration

I have a model with two objects: SFCHChat and SFCHMessages which have a one-to-many relationship. Due to an upgrade from Realm 0.98 to 2.0 I now get the following exception in production: Migration is required due to the following errors: - Property…
Nikolay Derkach
  • 1,734
  • 2
  • 22
  • 34
0
votes
1 answer

How to migrate a field from a boxed version to an unboxed version

I have a field that is a Double. I want to change it to a double field. Here's the code I have set up to do that: schema.get("Item") .addField("mOriginalWeightUnboxed",double.class) .transform(new RealmObjectSchema.Function() { …
shoe
  • 952
  • 1
  • 20
  • 44
0
votes
1 answer

Realm Android Migration to change primary key data type not writing data

I am using Realm android and wanted to change data type of existing primary key using Migration. I used following code for Migration schema.get("Test") .addField("id_new", String.class) .removeField("id") .addPrimaryKey("id_new") …
Rohan Peshkar
  • 65
  • 1
  • 11